How to grant a privilege to zabbix user for "SHOW SLAVE STATUS"
When you install zabbix on MySQL, you might see the following error message.
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
Now, let's check the privileges.
SELECT USER, HOST, SUPER_PRIV, REPL_CLIENT_PRIV FROM mysql.user WHERE USER = 'zabbix';
zabbix user does not have "REPL_CLIENT_"PRIV".
Let's grant the replication client permission to zabbix user.
Method #1. GRANT. (Recommendation)
GRANT REPLICATION CLIENT ON *.* TO 'zabbix'@'localhost'; GRANT REPLICATION CLIENT ON *.* TO 'zabbix'@'127.0.0.1';
Method #2. UPDATE mysql.user Table
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.
It will work.
No comments:
Post a Comment