mysql 查询当前连接数,和最大连接数
时间: 2023-08-27 17:41:51 浏览: 74
您可以使用以下 SQL 语句查询当前连接数和最大连接数:
```
SHOW STATUS WHERE `variable_name` = 'Threads_connected' OR `variable_name` = 'Max_used_connections';
```
其中,`Threads_connected` 表示当前连接数,`Max_used_connections` 表示最大连接数。
另外,您也可以使用以下 SQL 语句查询 MySQL 配置的最大连接数:
```
SHOW VARIABLES LIKE 'max_connections';
```
其中,`max_connections` 表示 MySQL 配置的最大连接数。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![exe](https://img-home.csdnimg.cn/images/20210720083343.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)