mysql错误分析

mysql错误分析

Data source rejected establishment of connection, message from server: “Too many connections”

错误原因

造成这种情况的原因:一种原因是访问量过高,MySQL服务器抗不住,这个时候就要考虑增加从服务器分散读压力;另一种原因就是MySQL配置文件中max_connections值过小。

解决方案

1.修改mysql的配置文件,增加如下信息:

max_connections=1000
max_user_connections=500
wait_timeout=200

2.登录mysql,手动配置

set max_connections=1000
set max_user_connections=500
set wait_timeout=200

查看mysql中变量的参数

show variables like '%max_connections%';

猜你喜欢

转载自blog.csdn.net/yiluohan0307/article/details/80514519