connection to database 'zabbix' failed:

本文介绍了在配置LNMP+zabbix过程中遇到的zabbix_server服务启动后10051端口缺失的问题及解决办法。通过检查日志,发现与mysql.sock链接相关,并提供了两种解决方案:创建mysql.sock链接重启数据库服务或修改zabbix_server.conf中的mysql.sock配置重启zabbix_server服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在配置LNMP+zabbix时,发现zabbix_server服务可以启动,但是没有10051这个端口。查看日志,报错如下:


发现日志链接不上:


查找这个文件所在的位置:

查找这个文件

解决方法有两种:

(一)创建mysql.sock链接


重启数据库服务


(二)修改zabbix_server.conf中的mysql.sock配置


重启zabbix_server服务



[root@localhost ~]# vi /var/log/zabbix/zabbix_server.log 29773:20250725:145659.307 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 29773:20250725:145659.307 database is down: reconnecting in 10 seconds 29773:20250725:145709.308 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 29773:20250725:145709.308 database is down: reconnecting in 10 seconds 29773:20250725:145719.309 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 29773:20250725:145719.309 database is down: reconnecting in 10 seconds 29773:20250725:145729.310 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 29773:20250725:145729.310 database is down: reconnecting in 10 seconds 29773:20250725:145739.310 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 29773:20250725:145739.310 database is down: reconnecting in 10 seconds 29773:20250725:145749.311 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 29773:20250725:145749.311 database is down: reconnecting in 10 seconds 29773:20250725:145752.039 Got signal [signal:15(SIGTERM),sender_pid:30435,sender_uid:0,reason:0]. Exiting ... 29773:20250725:145752.040 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 29773:20250725:145752.040 Cannot connect to the database. Exiting... 30441:20250725:145752.049 Starting Zabbix Server. Zabbix 4.0.50 (revision c40ad3289ad). 30441:20250725:145752.050 ****** Enabled features ****** 30441:20250725:145752.050 SNMP monitoring: YES 30441:20250725:145752.050 IPMI monitoring: YES 30441:20250725:145752.050 Web monitoring: YES 30441:20250725:145752.050 VMware monitoring: YES 30441:20250725:145752.050 SMTP authentication: YES 30441:20250725:145752.050 Jabber notifications: YES 30441:20250725:145752.050 Ez Texting notifications: YES 30441:20250725:145752.050 ODBC: YES 30441:20250725:145752.050 SSH support: YES 30441:20250725:145752.050 IPv6 support: YES 30441:20250725:145752.050 TLS support: YES 30441:20250725:145752.050 ****************************** 30441:20250725:145752.050 using configuration file: /etc/zabbix/zabbix_server.conf 30441:20250725:145752.052 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 30441:20250725:145752.052 database is down: reconnecting in 10 seconds 30441:20250725:145802.053 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 30441:20250725:145802.053 database is down: reconnecting in 10 seconds 30441:20250725:145812.053 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 30441:20250725:145812.054 database is down: reconnecting in 10 seconds 30441:20250725:145822.055 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 30441:20250725:145822.055 database is down: reconnecting in 10 seconds 30441:20250725:145832.056 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 30441:20250725:145832.056 database is down: reconnecting in 10 seconds 30441:20250725:145842.057 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 30441:20250725:145842.057 database is down: reconnecting in 10 seconds 30441:20250725:145852.058 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 30441:20250725:145852.058 database is down: reconnecting in 10 seconds
最新发布
07-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值