lifeistrue 发表于 2006-09-11 16:37

mysql的历史命令

在mysql中,可以按向上方向键来调出以前的命令,如何取消该功能?mysql是不是有一个类似操作系统的
.bash_history文件来记录历史命令?如果有,该文件的位置是?谢谢了!

dangk 发表于 2006-09-11 17:43

回复 1楼 lifeistrue 的帖子

在你所使用的用户的用户目录下
.mysql_history

lifeistrue 发表于 2006-09-11 17:48

OK,谢谢楼上的!

lifeistrue 发表于 2006-09-11 17:50

呵呵,一个新的问题,mysql有命令清空历史命令吗?在不手工编辑.mysql_history的情况下

dangk 发表于 2006-09-11 17:55

回复 4楼 lifeistrue 的帖子

On Unix, the mysql client writes a record of executed statements to a history file. By default, the history 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.

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.

lifeistrue 发表于 2006-09-11 19:49

回复 5楼 dangk 的帖子

非常详细的说明!谢谢!

dangk 发表于 2006-09-12 17:30

回复 6楼 lifeistrue 的帖子

是抄手册的,赫赫

mgunix 发表于 2015-11-04 11:07

cat~/.mysql_history
页: [1]
查看完整版本: mysql的历史命令