“获取MySQL版本号、连接数”的版本间的差异

来自姬鸿昌的知识库
跳到导航 跳到搜索
第11行: 第11行:
 
select *
 
select *
 
from information_schema.processlist;
 
from information_schema.processlist;
 +
</syntaxhighlight>查看 MySQL 支持的最大连接数<syntaxhighlight lang="sql">
 +
SHOW VARIABLES LIKE 'max_connections';
 
</syntaxhighlight>
 
</syntaxhighlight>

2024年11月27日 (三) 01:41的版本

version()函数返回数据库的版本号

select version();

查看当前连接数

show status like '%Threads_connected%';


查看当前连接

select *
from information_schema.processlist;

查看 MySQL 支持的最大连接数

SHOW VARIABLES LIKE 'max_connections';