Grant a privilege to zabbix user for "SHWO SLAVE STATUS"


If you can capture SQL Error Message, then you might see the message as below.

2017-01-01 01:01:01 zabbix[zabbix] @ localhost [] ERROR 1227: Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation : SHOW SLAVE STATUS


You can check the privileges as below.

SELECT USER, HOST, SUPER_PRIV, REPL_CLIENT_PRIV 

FROM mysql.user

WHERE USER = 'zabbix';


Then you need to update the privileges.

Method #1. GRANT. (Recommendation)

GRANT REPLICATION CLIENT ON *.* TO 'zabbix'@'localhost';

GRANT REPLICATION CLIENT ON *.* TO 'zabbix'@'127.0.0.1';


Method #2. UPDATE.

UPDATE mysql.user

SET

  REPL_CLIENT_PRIV = 'Y'

WHERE USER = 'zabbix';



Now, check the privileges again.

SELECT USER, HOST, SUPER_PRIV, REPL_CLIENT_PRIV 

FROM mysql.user

WHERE USER = 'zabbix';


That's it.

+ Recent posts