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

相关推荐
安当加密8 小时前
MySQL 数据库如何加密脱敏?TDE透明加密 + DBG数据库网关 双引擎加固实战
数据库·mysql·adb
IT技术分享社区8 小时前
MySQL统计查询优化:内存临时表的正确打开方式
数据库·mysql·程序员
短剑重铸之日8 小时前
7天读懂MySQL|Day 5:执行引擎与SQL优化
java·数据库·sql·mysql·架构
陌北v110 小时前
为什么我从 MySQL 迁移到 PostgreSQL
数据库·mysql·postgresql
就叫飞六吧13 小时前
mysql表字段反查表名脚本-筛选法-查表技巧
数据库·mysql
1.14(java)13 小时前
MySQL数据库操作全攻略
java·数据库·mysql
jmxwzy13 小时前
MySQL
数据库·mysql
飞Link15 小时前
【MySQL】Linux(CentOS7)下安装MySQL8教程
linux·数据库·mysql
阿拉伯柠檬16 小时前
MySQL内置函数
linux·数据库·mysql·面试
计算机学姐16 小时前
基于SpringBoot的送货上门系统【2026最新】
java·vue.js·spring boot·后端·mysql·spring·tomcat