ERROR 1045 (28000): Access denied for user ‘zabbix’@‘localhost’ (using password: YES)

搭建zabbix的过程中,使用web登陆本机zabbix首页的时候出现了“Database error Error connecting to database: Access denied for user ‘root’@‘localhost’ (using password: YES)”的提示,在直接登陆centos7上直接登陆zabbix也出现相同告警:

[root@centos7 ~]# mysql -uzabbix -p密码
ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: YES)

使用zabbix帐号密码无法登陆mariadb。
使用root账号登陆数据库,发现异常zabbix用户有2处重复了,使用drop user zabbix@localhost;删除1个,可以使用zabbix的用户名密码登陆了,但是网页报错还是没有变化。

[root@centos7 ~]# mysql -uroot -p密码
select host,user from mysql.user;

原因:这是 由于被空用户占用资源
解决:删除空用户即可

MariaDB [(none)]> drop user ''@localhost;

在这里插入图片描述

[root@centos7 ~]# mysql -uzabbix -p密码

这样就可以登录了

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐