返回首页DA系统C#IDE文件同步服务屏保 今天是: 2026-05-05    "立夏"  夏季的第一个节气,表示盛夏时节的正式开始

搜索
热搜: linux 技术
Hi~登录注册
查看: 1574|回复: 0

[转载] 【转载】mysql查看当前连接数

[复制链接]
发表于 2023-4-19 16:32:05 | 显示全部楼层 |阅读模式

少侠不来段修仙之旅吗~

您需要 登录 才可以下载或查看,没有帐号?注册成为修仙之旅的少年~

x
mysql查看当前连接数


查看当前连接数
SHOW STATUS LIKE 'Threads%';
Threads_connected显示的数值就是当前的连接数

查看当前各用户连接数据库的数量
select USER , count(*) from information_schema.processlist group by USER;

查看连接到数据库的客户端ip及各连接数
SELECT substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;

查看连接到数据库的账号、客户端ip及各连接数
SELECT user,substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;

查看最大连接数
SHOW VARIABLES LIKE '%max_connections%';

如果要修改最大连接数为500
set global max_connections=500;
也可以修改mysql配置文件max_connections=500,然后重启mysql生效



 楼主| 发表于 2023-4-19 16:38:24 | 显示全部楼层
啊,分区填错了~
回复 支持 反对

使用道具 举报

游客
回复
*滑块验证:

DA论坛飞机票来了~
快速回复 返回顶部 返回列表