我是zabbix的新用户。在更新了zabbix (从Zabbix4.0.8到Zabbix4.2.5)之后,我的web接口出现了问题。
The frontend does not match Zabbix database. Current database version (mandatory/optional): 4000000/4000006. Required mandatory version: 4020000. Contact your system administrator.
我打开一个日志文件,发现:
10344:20221123:151903.222 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)
10344:20221123:151903.222 database is down: reconnecting in 10 seconds
我检查了/usr/share/zabbix/conf/zabbix.con.php。
global $DB;
$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'localhost';
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'password';
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';
$ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'zabbix-test';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
如果我用密码登录mysql,它就能工作。
mysql -u zabbix -h localhost --database=zabbix -p
如果没有密码,它就无法工作。
mysql -u zabbix -h localhost --database=zabbix
ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: NO)
据我所知,问题是zabbix在登录过程中不使用密码。
我试过:
mysql> grant all privileges on zabbix.* to zabbix@localhost;
试图更新代理:
apt-get install --only-upgrade zabbix-proxy-mysql
0 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.
发布于 2022-11-25 05:24:33
在更新zabbix之后,zabbix_server.conf已经更改。我发现我的DB密码被注释掉了。
DBUser=zabbix
### Option: DBPassword
# Database password.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword
我写了密码就行了。
DBPassword=yourpassword
https://stackoverflow.com/questions/74550822
复制相似问题