zabbix 使用mysql -uxxx -pxxx -Pxxx的时候,会如下报错
Warning: Using a password on the
command
line interface can be insecure
报错原因是mysql 5.6版本增加了密码安全策略,之前版本可以使用的命令行里加上密码就会强制报错,所以使用zabbix lld监控mysql的时候,就会由于收到此报错导致没办法监控。
解决方法:
# vim my.cnf
[client]
host=localhost
user=dump
password='dump'
新的语句
mysql --defaults-file=~/.my.conf -e 'show global status'
mysqldump --defaults-file=~/.my.conf testing > testing.sql