如何在MySQL中编程设置max_connections?
要在MySQL中编程设置max_connections,您可以使用SET命令。语法如下 –
SET GLOBAL max_connections=yourIntegerValue;
让我们实现上述查询以设置最大连接数。查询如下 –
mysql> set global max_connections=1000;
查询 OK,0 行受到影响(0.04 秒)
使用show variables命令检查是否设置了最大连接数。查询如下:
mysql> show variables like 'max_connections';
以下是输出结果。
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 1000 |
+-----------------+-------+
1 行记录(0.18 秒)
阅读更多:MySQL 教程
极客教程