How to solve MySQL max_user_connections error

前端 未结 5 1340
花落未央
花落未央 2020-12-03 15:37

I\'m getting following error when I try to log onto phpMyAdmin.

User ** already has more than \'max_user_connections\' active connections

Could anyo

5条回答
  •  眼角桃花
    2020-12-03 15:54

    Read max_connections document to solve your problem

    If clients encounter Too many connections errors when attempting to connect to the mysqld server, all available connections are in use by other clients.

    The permitted number of connections is controlled by the max_connections system variable. The default value is 151 to improve performance when MySQL is used with the Apache Web server. To support more connections, set max_connections to a larger value.

    First: Check your current database max_connection variable

    SHOW VARIABLES LIKE 'max_connections';
    +-----------------+-------+
    | Variable_name   | Value |
    +-----------------+-------+
    | max_connections | 151   |
    +-----------------+-------+
    

    Then Try to increase the max_connection parameter either with running command like:

     SET GLOBAL max_connections = 300;
    

    Or set this parameter in my.cnf that located at /etc/my.cnf

    vi /etc/my.cnf
    max_connections = 300
    

    Finally: Restart mysql service

提交回复
热议问题