InformationOn Linux/UNIX, the MySQL client logs statements executed interactively to a history file. The default MySQL Client file is named .mysql_history in the user's home directory. The files are split by language and named history.sql, history.js and history.py. Most interactive commands run in the MySQL client application are saved to a history file. The MySQL command history should be disabled.
Disabling the MySQL command history reduces the probability of exposing sensitive information, such as password, encryption keys, or other sensitive data or information.
NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.
SolutionPerform the following steps to remediate this setting:
Remove .mysql_history if it exists.
Use either of the techniques below to prevent it from being created again:
Set the MYSQL_HISTFILE environment variable to /dev/null. This will need to be placed in the shell's startup script.
Create $HOME/.mysql_history as a symbolic to /dev/null.
> ln -s /dev/null $HOME/.mysql_history
By default, the MySQL command history file is located in $HOME/.mysql_history.