新手刚来 发表于 2012-02-28 09:17

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

大家好,麻烦问一下,如何查看在mysql中操作过的所有的命令?
新手谢谢大家了。

horizonhyg 发表于 2012-02-28 09:23

本帖最后由 horizonhyg 于 2012-02-28 09:25 编辑

家目录下的.mysql_history隐藏文件

新手刚来 发表于 2012-02-28 09:34

太谢谢了兄弟,找到了

RogerZhuo 发表于 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.

RogerZhuo 发表于 2012-02-28 23:08

回复 2# horizonhyg
在生产环境中,是不是都要禁呢? 以前一直没有注意这个;:wink:

   

horizonhyg 发表于 2012-02-29 09:07

回复 5# RogerZhuo


    恩,安全至上,禁了为好

909413335 发表于 2012-02-29 15:20

学习了。

ruochen 发表于 2012-03-06 17:30

最近你们几个讨论的不错啊

lanni654321 发表于 2015-08-26 16:20

页: [1]
查看完整版本: 大家好,麻烦问一下,如何查看在mysql中操作过的所有的命令