[Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

时间:2024-11-30 15:05:37

在配置了zabbix服务端后,发现:“zabbix server is running”的Value值是“no”

[Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

用:netstat -atnlp|grep 10051

发现没有出现zabbix_server的10051端口。在网上找了很多办法,发现都不管用。

通过查看日志看到如下错误提示:

tail /tmp/zabbix_server.log

[Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

解决方法:

用root帐号登录mysql

然后执行:

mysql> grant all on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix' with grant option;

mysql>flush privileges;

再查看zabbix管理页面,发现已恢复正常。“zabbix server is running”的Value值是“yes”。

查看/tmp/zabbix_server.log的内容也恢复正常。

[Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

执行:netstat -atnlp | grep 10051

发现端口号终于出现了!

[Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)