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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysqldump提示Warning: Using a password on the command line interface can be insecure.相关的知识,希望对你有一定的参考价值。

场景:

主机A和主机B在局域网内,之前一直在主机A上用计划任务在跑mysqldump去备份主机B上的数据库,前两天突然出现:Warning: Using a password on the command line interface can be insecure.


之前的计划任务的代码是:

mysqldump -h10.255.xxx.xxx  -uroot -pxxxx dbxxx | gzip > /root/Db/Backup/DbName_$(date +\%Y\%m\%d-\%H).sql.gz

然后直接在主机A上执行,会提示Warning: Using a password on the command line interface can be insecure. 并且备份不成功。


然后把代码改为:

mysqldump -uroot -pxxxx -h 10.255.xxx.xxx dbxxx | gzip > /root/Db/Backup/DbName_$(date +\%Y\%m\%d-\%H).sql.gz (就是把-h的参数放在后面)

再执行,依然会提示Warning: Using a password on the command line interface can be insecure.但是可以备份成功。



以上是关于mysqldump提示Warning: Using a password on the command line interface can be insecure.的主要内容,如果未能解决你的问题,请参考以下文章

MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface ca

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

解决导出Excel时提示“Warning: Maximum number of format records exceeded. Using default format”

mysqldump导出数据出现问题

Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.

WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.