Mairadb 最大连接数、当前连接数 查询

目录

[查询数据库 最大连接数](#查询数据库 最大连接数)

查询当前连接总数


环境 Mariadb 10.11.6

跳转mysql数据库:

查询数据库 最大连接数

show variables like 'max_connections';

注意; 这个版本不能使用 : show variables like '%max_connections%'; 会报错 ,如图所示:

他不认识 这个 %max_connections%

MariaDB mysql> show variables like '%max_connections%';

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''%max_connections%'' at line 1

可以看到目前最大连接数是1000.

查询当前连接总数

show status like 'Threads_connected';

通过查询**information_schema 中的processlist 数量**也能获取当前连接数:

通过show processlist可以 查看 连接详情:

相关推荐
☆凡尘清心☆10 小时前
CentOS Stream 9 专用 LNMP 全自动一键脚本
linux·运维·mysql·nginx·lnmp·centos stream 9
xqqxqxxq14 小时前
DML 表数据:插入、删除、修改
笔记·mysql
xxwl58515 小时前
数据库后端接口测试报告
spring boot·mysql·tomcat
xqqxqxxq15 小时前
MySQL 数据类型笔记
数据库·笔记·mysql
Logintern0916 小时前
理解MySQL数据库的“事务与锁”
数据库·mysql
朱容zr33313316 小时前
为什么推荐使用自增主键?使用UUID作为主键的优缺点是什么?
java·运维·数据库·后端·mysql·面试·性能优化
brave_zhao17 小时前
mysql的安装
数据库·mysql
冷凝娇18 小时前
【MySQL】2026总结(一)
数据库·mysql
神龙天舞20011 天前
MySQL 备库为什么会延迟好几个小时
android·数据库·mysql