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:
This directs your mysql history to /dev/null
- Apply your changes with:
Login into mysql and run some commands.
Verify that the ~/.mysql_history file has not been created :)