D
D
demudrol2016-10-13 16:55:05
MySQL
demudrol, 2016-10-13 16:55:05

Why can't zabbix get response from MySQL query?

I create a folder /var/lib/zabbix
Under the zabbix user I run

mysql_config_editor set --login-path=local --host=localhost --user=user --password

The /var/lib/zabbix/.mylogin.cnf file appears. I
create a UserParameter with text
UserParameter=mySQLelement, mysql --login-path=local -N -B -e 'select count(*) from database;' db

I execute a command zabbix_agentd -t "mySQLelement"
In the answer comes mySQLelement [t|15]
Everything is normal.
But when I create an element with this key on the Zabix server, I get only
Received value [ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db']

Zabix agent on the client runs under the zabbix user.
How does it turn out that I get the correct answer directly from the console, but an error is transmitted to the server?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay, 2016-10-13
@iNickolay

Access denied for user ''@'localhost' to database 'db']
See configs. You do not have a user specified, and therefore swears that there is no access to db.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question