MySQL 5.6 警告信息 command line interface can be insecure 修复

jackxiang 2017-6-24 12:49 | |
MySQL 5.6 警告信息 command line interface can be insecure 修复

mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.


在命令行输入密码,就会提示这些安全警告信息。
Warning: Using a password on the command line interface can be insecure.

注: mysql -u root -pPASSWORD 或 mysqldump -u root -pPASSWORD 都会输出这样的警告信息.
1、针对mysql
mysql -u root -pPASSWORD 改成mysql -u root -p 在输入密码即可.

2、mysqldump就比较麻烦了,通常都写在scripts脚本中。

解决方法:
对于 mysqldump 要如何避免出现(Warning: Using a password on the command line interface can be insecure.) 警告信息呢?

vim /etc/mysql/my.cnf
[mysqldump]
user=your_backup_user_name
password=your_backup_password

修改完配置文件后, 只需要执行mysqldump 脚本就可以了。备份脚本中不需要涉及用户名密码相关信息。

来自:http://880314.blog.51cto.com/4008847/1348413

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/9261/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2017-6-27 22:20
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]