一、先授权让zabbix连接数据库:
1 |
mysql -uroot -ppassword -e"GRANT USAGE ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbix'"; |
二、建立数据库连接信息文件:vim /usr/local/zabbix/etc/.my.cnf
1 2 3 4 5 6 7 8 9 10 11 |
# Zabbix Agent [mysql] host=localhost user=zabbix password=zabbix socket= /var/lib/mysql/mysql.sock [mysqladmin] |