获取MySQL版本号、连接数

来自姬鸿昌的知识库
跳到导航 跳到搜索

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;