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

相关推荐
打工的小王29 分钟前
postgresql和mysql对比
数据库·mysql·postgresql
codeejun3 小时前
每日一Go·MySQL-15、慢查询日志实战分析(从 0 到 1 实战排查慢 SQL)
sql·mysql·golang
Decay__5 小时前
SQLServer 监控体系构建 —— sql_exporter + Prometheus + Grafana 全栈实战
运维·数据库·sql·mysql·架构
飞奔的瓜牛6 小时前
Nacos 三节点集群部署手册:MySQL 持久化 + Nginx 负载均衡
mysql·nginx·负载均衡
Umi·6 小时前
MySQL之多表关联查询练习
数据库·mysql
实泽有之,无泽虚之6 小时前
Windows环境bat脚本自动备份MySQL数据库并清理旧备份文件
数据库·mysql
csdn_aspnet6 小时前
【Docker 攻略】MySQL 安裝篇
运维·mysql·docker·容器
FungLeo7 小时前
FengCMS · PHP+MySQL 升级实录· 代码审计怎么闭环:REVIEW到 CLOSURE 四件套,12 个域90 篇修复文档跟到底
开发语言·mysql·php·代码审计·fengcms
索西引擎7 小时前
MySQL 进阶:锁机制
数据库·mysql
FungLeo8 小时前
FengCMS · PHP+MySQL 升级实录 · 一个不懂PHP 的后端,三天 216次提交完成十三年老站安全升级(项目复盘)
mysql·安全·php·安全加固·fengcms