1.3 Disable MySQL Command History - ~/.mysql_history

Information

On Linux/UNIX, the MySQL client logs statements executed interactively to a history file. By default, this file is named .mysql_history in the user's home directory. Most interactive commands run in the MySQL client application are saved to a history file. The MySQL command history should be disabled.

Solution

Perform the following steps to remediate this setting:
1. Remove .mysql_history if it exists.
2. Use either of the techniques below to prevent it from being created again:
1. Set the MYSQL_HISTFILE environment variable to /dev/null. This will need to be placed in the shell's startup script.
2. Create $HOME/.mysql_history as a symbolic to /dev/null.
> ln -s /dev/null $HOME/.mysql_history

See Also

https://benchmarks.cisecurity.org/tools2/mysql/CIS_Oracle_MySQL_Community_Server_5.6_Benchmark_v1.0.0.pdf

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-7, CSCv6|9.1

Plugin: Unix

Control ID: b74cd8837fb5687c9157ce2d0992a1643955608c346d7567550b726e9bb25c12