赞
踩
MySQL的“Too many connections”错误通常表示您的应用程序或服务器已经达到了其最大连接数。这可能是由于多种原因,例如应用程序配置不当、连接未正确关闭或服务器资源不足。方法如下:
show variables like 'max_connections';
set global max_connections=1000;
修改mysql的配置文件my.cnf
[mysqld]
max_connections = 1000
show global variables like 'wait_timeout';
set global wait_timeout=300;
[mysqld]
group_concat_max_len = 10240
# 最大睡眠时间
wait_timeout=300
# 超时时间设置
interactive_timeout = 500
#mysql重启命令
systemctl restart mysqld.service
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。