Disable MySql History
Sometimes it’s a good idea to prevent mysql from writing a history file. The mysql history file contains all the commands you type across all sessions.
Your default mysql history file is ~/.mysql_history.
As this is an obvious security risk, it is sometimes a good idea to disable this file.
To disable mysql history do the following:
Delete your existing ~/.mysql_history file.
Edit your ~/.profile file and add the following:
export MYSQL_HISTFILE=/dev/null
This directs your mysql history to /dev/null
- Apply your changes with:
source ~/.profile
Login into mysql and run some commands.
Logout.
Verify that the ~/.mysql_history file has not been created :)