Mysql最大连接数配置
查询数据库连接数
mysql> show status like 'Threads%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_cached | 0 |
| Threads_connected | 1 |
| Threads_created | 1 |
| Threads_running | 1 |
+-------------------+-------+
4 rows in set (0.00 sec)
Threads_running:打开连接数
Threads_connected:活跃连接数
查询最大连接数
mysql> show variables like '%max_connections%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connections| 151 |
+--------------------+-------+
2 rows in set (0.00 sec)
max_connections:最大连接数
修改最大连接数
命令修改,立即生效重启失效
mysql> set global max_connections = 1000;
添加配置,重启后生效
[mysqld]
max_connections = 1000

浙公网安备 33010602011771号