Zabbix-Mysql8 安装中的坑

发布于 2023-09-20  327 次阅读


今天在阿里云上开了个centos7 来装zabbix
安装版本:
mysql8.0
zabbix5.0
httpd
rh-php72
整个安装过程还算好,但是在启动的时候出现了问题,zabbix-server没起来
查看日志发现错误信息为

using configuration file: /etc/zabbix/zabbix_server.conf
 26501:20210805:161958.333 [Z3001] connection to database 'zabbix' failed: [2059] Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

这个是zabbix-server连接数据库失败,原因就是密码验证问题
查询度娘和mysql官网后才发现这是个mysql8的一个坑
解决办法:
mysql -uroot -p
>select user,host,plugin from user;
#查看zabbix用户的的plugin为 caching_sha2_password 需要改成上个版本的
>ALTER USER zabbix@localhost IDENTIFIED WITH mysql_native_password BY 'yourpassword';
>FLUSH PRIVILEGES;

一沙一世界,一花一天堂。君掌盛无边,刹那成永恒。