获取MySQL版本号、连接数
Jihongchang(讨论 | 贡献)2024年11月27日 (三) 01:59的版本
version()函数返回数据库的版本号
select version();
查看当前连接数
show status like '%Threads_connected%';
查看当前连接
select *
from information_schema.processlist;
查看 MySQL 支持的最大连接数
SHOW VARIABLES LIKE 'max_connections';
查看当前连接 MySQL 的客户端
select distinct(regexp_substr(host, '(\\d+\\.)+\\d+'))
from information_schema.processlist;