How to increase MySQL connections(max_connections)?

后端 未结 3 1966
眼角桃花
眼角桃花 2020-11-29 21:28

Every socket of MySQL Database will have defaults connections as 100 but I am looking for any way to increase the number of possible connections > 100 to a socket connection

3条回答
  •  离开以前
    2020-11-29 21:45

    If you need to increase MySQL Connections without MySQL restart do like below

    mysql> show variables like 'max_connections';
    +-----------------+-------+
    | Variable_name   | Value |
    +-----------------+-------+
    | max_connections | 100   |
    +-----------------+-------+
    1 row in set (0.00 sec)
    
    mysql> SET GLOBAL max_connections = 150;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> show variables like 'max_connections';
    +-----------------+-------+
    | Variable_name   | Value |
    +-----------------+-------+
    | max_connections | 150   |
    +-----------------+-------+
    1 row in set (0.00 sec)
    

    These settings will change at MySQL Restart.


    For permanent changes add below line in my.cnf and restart MySQL

    max_connections = 150
    

提交回复
热议问题