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可以 查看 连接详情:

相关推荐
j7~7 小时前
【MYSQL】在Centos7和ubuntu22.04环境下安装
数据库·c++·mysql·ubuntu·centos
Donk_678 小时前
MariaDB 数据库管理手册
数据库·mariadb
常常有12 小时前
AI智能知识库问答系统(基于 FastAPI和Dify)
python·mysql·fastapi
Waay12 小时前
MySQL基础高频考点
运维·mysql·adb
omenkk714 小时前
【MySQL专题】1.一条更新SQL语句是如何执行的
数据库·sql·mysql
Lehjy14 小时前
【MySQL】库的操作
数据库·mysql·oracle
Languorous.14 小时前
MySQL CRUD实操详解:插入、查询、修改、删除,附可直接运行示例
数据库·mysql
重生之小比特14 小时前
【MySQL 数据库】用户管理与权限控制
android·数据库·mysql
杨云龙UP14 小时前
MySQL主库高峰期备份引发504故障:从库手动切换接管 + 主从恢复同步 + Docker版DB2重启实战_2026-05-17
linux·运维·数据库·mysql·docker·容器·centos
小帅记事14 小时前
MySQL 查询性能监控与分析 完整版
mysql