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

在用户访问MySQL控制台时,所有的命令历史都被记录在~/.mysql_history中。如果攻击者访问这个文件,他就可以知道数据库的结构。

vim /etc/profile

export MYSQL_HISTFILE=/dev/null

source /etc/profile

echo > /root/.mysql_history

cat /root/.mysql_history

猜你喜欢

转载自blog.csdn.net/qq_40460909/article/details/80571060