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

mysql5.6版本在执行mysqldump自动化备份的时候,由于脚本是自动化运行,所以必须在shell中写入mysql用户的密码,但是执行之后,出现如下错误:

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

原因是5.6之后密码写在命令行不安全,解决方案是将用户名密码卸载配置文件中

vi /etc/my.cnf

在my.cnf中增加如下代码

[mysqldump]
host=localhost
user=username
password='password'

再次执行备份命令如下

mysqldump yourdatabase > database.sql

 

发表评论

电子邮件地址不会被公开。

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>