MYSQL – TO AVOID ‘Warning: Using a password on the

zabbix 使用mysql -uxxx -pxxx -Pxxx的時候,會以下報錯mysql

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

報錯緣由是mysql 5.6版本增長了密碼安全策略,以前版本能夠使用的命令行里加上密碼就會強制報錯,因此使用zabbix lld監控mysql的時候,就會因爲收到此報錯致使沒辦法監控。shell

解決方法:vim

# 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
相關文章
相關標籤/搜索