1、grant user for mysql
GRANT
USAGE ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY "zabbix";
2、touch /var/lib/zabbix/.my.cnf
# Zabbix Agent
[mysql]
host=localhost
user=zabbix
password=zabbix
socket=/tmp/mysql.sock
[mysqladmin]
host=localhost
user=zabbix
password=zabbix
socket=/tmp/mysql.sock
3、cp userparameter_mysql.conf
/etc/zabbix/zabbix_agentd.d/
HOME=/var/lib/zabbix #where store mysql grant user info ,after it
mysql is mysql command full path
4、vim /etc/zabbix/zabbix_agentd.com
Include=/etc/zabbix/zabbix_agentd.d/
5、/etc/init.d/zabbix_agentd restart
6、zabbix_get -s 127.0.0.1 -kmysql.status[Com_begin]
7、ApplyTemplate App MySQL