MySQL 8.0.29で最大同時コネクション数の上限を変更する

環境
Ubuntu 22.04 LTS
MySQL 8.0.29-0ubuntu0.22.04.2

書式
SET GLOBAL max_connections = 値

1.最大同時コネクション数の上限を確認します

mysql> SHOW GLOBAL VARIABLES like 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 151   |
+-----------------+-------+
1 row in set (0.16 sec)

2.最大同時コネクション数の上限を15に変更します

mysql> SET GLOBAL max_connections = 15;
Query OK, 0 rows affected (0.04 sec)

3.変更確認

mysql> SHOW GLOBAL VARIABLES like 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 15    |
+-----------------+-------+
1 row in set (0.00 sec)

 

MySQL

Posted by arkgame