记一次MySQL操做历史记录清空/root/.mysql_history

在用户访问MySQL控制台时,全部的命令历史都被记录在~/.mysql_history中。若是攻击者访问这个文件,他就能够知道数据库的结构。mysql

vim /etc/profilesql

export MYSQL_HISTFILE=/dev/null
数据库

source /etc/profilevim

echo > /root/.mysql_historyspa

cat /root/.mysql_history
file