您现在的位置是:首页 > Mysql

李清波 2020-03-05 Mysql 2993 复制当前网址

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  


文章来源:https://www.liqingbo.com/blog-1669.html

评论