取消history敏感的历史记录

HISTCONTROL=ignorespace

在输入带密码命令时候,前面加上空格。

如果想让这天命令永久生效,需要放在环境变量中。

echo "HISTCONTROL=ignorespace" >>/etc/profile

source /etc/profile或者. /etc/profile

也可以使用交互式登陆,避免密码被人知道。

[root@db01-51 bin]# mysql -uroot -p -S /data/3307/mysql.sock
Enter password:

posted @ 2017-03-16 11:24  reborn枪  阅读(116)  评论(0)    收藏  举报