mysql 报错:Using a password on the command line interface can be insecure.

意思:在命令行中直接输入密码账号信息是不安全的

这个是在MySQL5.6版本以后才出现的

出现场景

1、登录mysql的时候

#mysql -uroot -p数据库密码

Using a password on the command line interface can be insecure.

解决方式:

#mysql -uroot -p   回车,提示输入密码

2、在mysqldump中使用

#mysqldump -uroot -p你的密码 数据库名 > 存放位置 备份文件名.sql

Using a password on the command line interface can be insecure.

解决方法修改mysql配置文件

#vim /etc/my.conf

加入下面内容:

[mysqldump]
user=root
password=你的密码

然后重启服务器,修改mysqldump语句,去掉-uroot -p参数

#mysqldump 数据库名 > 存放位置 备份文件名.sql  

猜你喜欢

转载自blog.csdn.net/xq30397022/article/details/79696066
今日推荐