show variables like ‘%max_connection%’; 查看最大连接数
set global max_connections=1000; 重新设置最大连接数
mysql> show status like ‘Threads%’;
±------------------±------+
| Variable_name | Value |
±------------------±------+
| Threads_cached | 32 |
| Threads_connected | 10 |
| Threads_created | 50 |
| Threads_rejected | 0 |
| Threads_running | 1 |
±------------------±------+
5 rows in set (0.00 sec)
Threads_connected :这个数值指的是打开的连接数.
Threads_running :这个数值指的是激活的连接数,这个数值一般远低于connected数值.
Threads_connected 跟show processlist结果相同,表示当前连接数。准确的来说,Threads_running是代表当前并发数
查询数据库当前设置的最大连接数
mysql> show variables like ‘%max_connection%’;
±----------------------±------+
| Variable_name | Value |
±----------------------±------+
| extra_max_connections | |
| max_connections | 2512 |
±----------------------±--