今天在阿里云上開了個(gè)centos7 來(lái)裝zabbix
安裝版本:
mysql8.0
zabbix5.0
httpd
rh-php72
整個(gè)安裝過(guò)程還算好靶橱,但是在啟動(dòng)的時(shí)候出現(xiàn)了問(wèn)題,zabbix-server沒起來(lái)
查看日志發(fā)現(xiàn)錯(cuò)誤信息為
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
這個(gè)是zabbix-server連接數(shù)據(jù)庫(kù)失敗有鹿,原因就是密碼驗(yàn)證問(wèn)題
查詢度娘和mysql官網(wǎng)后才發(fā)現(xiàn)這是個(gè)mysql8的一個(gè)坑
解決辦法:
mysql -uroot -p
>select user,host,plugin from user;
#查看zabbix用戶的的plugin為 caching_sha2_password 需要改成上個(gè)版本的
>ALTER USER zabbix@localhost IDENTIFIED WITH mysql_native_password BY 'yourpassword';
>FLUSH PRIVILEGES;
再去查看日志摔握,恢復(fù)正常