您的位置:首页 > 数据库 > MySQL

MySQL 解决数据导出问题:Using a password on the command line interface can be insecure.

2016-06-17 12:17 1206 查看
当使用mysql导出命令:mysqldump -uroot -proot test_db>test_db_bak.sql

警告提示信息:"Warning: Using a password on the command line interface can be insecure."

此问题会出现在MySQL5.6版本以上,警告在命令行界面上使用明文密码不安全

可以使用如下方法解决此问题:

1、打开my.cnf配置文件

vi /etc/my.cnf

2、添加用户和密码,我数据库用户和密码是root

[mysqldump]

user=root

password=root

3、保存退出

esc  “:wq”

4、重启mysql

service mysql restart

5、mysqldump 数据库名 > 备份文件名,此时运行导出命令不再需要输入用户名和密码了

例如: mysqldump test_db > test_db_bak.sql
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: