免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5846 | 回复: 8
打印 上一主题 下一主题

大家好,麻烦问一下,如何查看在mysql中操作过的所有的命令 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-02-28 09:17 |只看该作者 |倒序浏览
大家好,麻烦问一下,如何查看在mysql中操作过的所有的命令?
新手谢谢大家了。

论坛徽章:
0
2 [报告]
发表于 2012-02-28 09:23 |只看该作者
本帖最后由 horizonhyg 于 2012-02-28 09:25 编辑

家目录下的.mysql_history隐藏文件

论坛徽章:
0
3 [报告]
发表于 2012-02-28 09:34 |只看该作者
太谢谢了兄弟,找到了

论坛徽章:
0
4 [报告]
发表于 2012-02-28 23:07 |只看该作者
手册上找了一段
On Unix, the mysql client writes a record of executed statements to a history file. By default, this file is named
.mysql_history and is created in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment
variable.
The .mysql_history should be protected with a restrictive access mode because sensitive information might be written to it,
such as the text of SQL statements that contain passwords. See Section 5.3.2.2, “End-User Guidelines for Password Security”.
It is possible to suppress logging of statements to the history file by using the --batch or --execute option.
If you do not want to maintain a history file, first remove .mysql_history if it exists, and then use either of the following techniques:
• Set the MYSQL_HISTFILE variable to /dev/null. To cause this setting to take effect each time you log in, put the setting
in one of your shell's startup files.
• Create .mysql_history as a symbolic link to /dev/null:
shell> ln -s /dev/null $HOME/.mysql_history
You need do this only once.

论坛徽章:
0
5 [报告]
发表于 2012-02-28 23:08 |只看该作者
回复 2# horizonhyg
在生产环境中,是不是都要禁呢? 以前一直没有注意这个;:wink:

   

论坛徽章:
0
6 [报告]
发表于 2012-02-29 09:07 |只看该作者
回复 5# RogerZhuo


    恩,安全至上,禁了为好

论坛徽章:
0
7 [报告]
发表于 2012-02-29 15:20 |只看该作者
学习了。

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
8 [报告]
发表于 2012-03-06 17:30 |只看该作者
最近你们几个讨论的不错啊

论坛徽章:
9
寅虎
日期:2014-06-03 14:10:05午马
日期:2015-01-08 16:49:52白羊座
日期:2015-01-16 12:58:182015年迎新春徽章
日期:2015-03-04 09:57:092015元宵节徽章
日期:2015-03-06 15:51:33NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2015-08-04 06:20:0015-16赛季CBA联赛之北京
日期:2015-12-14 09:40:0315-16赛季CBA联赛之青岛
日期:2016-07-25 11:23:07
9 [报告]
发表于 2015-08-26 16:20 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP