网站老出现user 'test' has exceeded the 'max_user_connections' resource (current value:2)查看了一下配置,配置的max_user_connections为25,为什么上面显示是为2呢?show status like '%max%';
也没有显示出max_user_connections的值
只显示了max_connections的值?而且访问人数非常的少。

解决方案 »

  1.   

    show variables like '%max%';
    show processlist看看有都少个用户连接
      

  2.   

    检查一下这个用户的最大连接数。MYSQL中可以针对每个用户设置用这个用户账号的最大连接数。以防止一个用户把的所有资源都占用。
      

  3.   

    查看mysql.user表的max_user_connections列,对于‘test’这一行,应该可以看到它的值。把它设置成0就可以打破限制了。语句是:
    grant usage on *.* to test max_user_connections=0;
    这样设置以后,该用户同时在线限制值就是你的系统变量max_user_connections的值,如果你再把这个值也置为0,那么就完全没有限制了。
    另外,你应该show global variables like 'max_user_connections';