Hi All,
MySQL stores the commands typed in the mysql> prompt in the ~/.mysql_history file.
In order to view MySQL history
# cat ~/.mysql_historyWe can disable mysql history using MYSQL_HISTFILE environment variable
First, remove the ~/.mysql_history file
$ rm ~/.mysql_historySet the MYSQL_HISTFILE env variable to /dev/null
$ export MYSQL_HISTFILE=/dev/null
$ set | grep MYSQL
MYSQL_HISTFILE=/dev/nullWe can also disable mysql history by pointing .mysql_history to /dev/null
$ rm ~/.mysql_historyCreate a symbolic link of ~/.mysql_history pointing to /dev/null as shown below.
$ ln -s /dev/null ~/.mysql_historyNow, login to the mysql and execute few sql commands. You’ll notice that ~/.mysql_history file is empty and does not store any previously typed commands.
Thanks