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

相关推荐
桦01 小时前
【MySQL】视图
数据库·mysql
java_logo3 小时前
Kubernetes Dashboard Docker 容器化部署指南
运维·mysql·docker·云原生·容器·kubernetes·php
Chan164 小时前
热点数据自动缓存方案:基于京东 Hotkey 实践
java·数据库·redis·mysql·spring·java-ee·intellij-idea
y***61315 小时前
在Spring Boot项目中使用MySQL数据库
数据库·spring boot·mysql
佛祖让我来巡山5 小时前
MySQL从零到精通:基础入门与SQL核心操作详解(含MySQL 5/8差异)
mysql·mysql基础·mysql入门
艾斯比的日常5 小时前
MySQL 锁机制深度解析:从原理到实践
数据库·mysql
linuxxx1105 小时前
高考志愿填报辅助系统
redis·后端·python·mysql·ai·django·高考
Code Warrior6 小时前
【MySQL数据库】数据类型
android·数据库·mysql
q***44927 小时前
如何在 Ubuntu 22.04 上安装 MySQL
linux·mysql·ubuntu
r***86988 小时前
mysql的主从配置
android·mysql·adb