#默认最大连接数 mysql> show variables like '%max_connections%' ; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 151 | +-----------------+-------+ 1 row in set (0.00 sec) #调整最大连接数 mysql> set global max_connections = 1000; Query OK, 0 rows affected (0.00 sec) #查看最大连接数 mysql> show variables like '%max_connections%' ; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 1000 | +-----------------+-------+ 1 row in set (0.00 sec) <br> #限制每个用户session连接数 mysql> show global status like 'Max_used_connections' ; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | Max_used_connections | 152 | +----------------------+-------+ 1 row in set (0.00 sec) 备注: 1、max_connections :是对整个服务器的用户限制,整个服务器只能开这么多session,而不考虑用户。这个参数实际起作用的最大值(实际最大可连接数)为16384 |