[Z3001]connection to database 'zabbix' failed: [1040] Too many connections 问题及处理

本文介绍了解决Zabbix在Ubuntu14.0.4环境下因MySQL连接数过多导致服务无法正常启动的问题。通过调整MySQL的最大连接数设置,成功解决了Zabbix的服务启动问题。

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

在Ubuntu 14.0.4环境下部署Zabbix时,Zabbix服务启动不了:一启动就自动关闭。

排查Zabbix的日志文件,发现有大量的MySQL连接错误:

[Z3001]connection to database 'zabbix' failed: [1040] Too many connections

问题原因:Zabbix连接MySQL的请求比较多,而MySQL默认安装时,最大连接数默认值为100,解决该问题的办法就是把MySQL的最大连接数修改大一点,我改到1000.

然后重启MySQL服务、Zabbix服务,问题解决。

[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、付费专栏及课程。

余额充值