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

相关推荐
EatFan2 小时前
MySQL 与 Redis 双写一致性实战:从 Cache-Aside 到延迟双删,再到 Binlog 兜底
数据库·redis·mysql
扑火的小飞蛾7 小时前
生产级SOP:MySQL二进制安装与多实例部署实战(5.6/5.7/8.0/8.4全版本)
数据库·mysql·adb
箓维8 小时前
MySQL_表的约束
android·数据库·mysql
无级程序员10 小时前
dolphinscheduler3.x从mysql迁移到postgresql
数据库·mysql·postgresql
HEJOO911 小时前
MySQL 日期时间类型怎么选:DATE、DATETIME、TIMESTAMP、TIME、YEAR 全解析
android·数据库·mysql
codeejun13 小时前
每日一Go·MySQL-28、账户转账事务设计
开发语言·mysql·golang
箓维14 小时前
MySQL_数据类型
数据库·mysql
千寻技术帮15 小时前
医院挂号小程序(源码+脚本+文档)50031
mysql·微信小程序·小程序·毕业设计·医院管理·医院挂号
程序猿老A17 小时前
轻量应用服务器怎么配置mysql
android·mysql·adb
weixin_3993806917 小时前
TongWeb 数据源报「连接中断」?一个验证超时与 MySQL 驱动兼容的排查记录 by lqw+sy+jjx
数据库·mysql