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

相关推荐
光羽隹衡4 小时前
MySQL的安装
数据库·mysql
脸大是真的好~4 小时前
尚硅谷-mysql专项训练-数据库服务的优化-慢查询-EXPLAIN字段
数据库·mysql·性能优化
一招定胜负5 小时前
navicat连接数据库&mysql常见语句及操作
数据库·mysql
阿海5745 小时前
备份mysql数据的shell脚本
mysql
sayyy6 小时前
【Docker】 安装 mysql8.0
mysql·docker
CodeAmaz7 小时前
MySQL索引,以及它们的好处和坏处
数据库·mysql·面试题·索引
四谎真好看8 小时前
MySQL学习笔记(基础篇1)
笔记·学习·mysql·学习笔记
小毅&Nora8 小时前
【后端】【JAVA】MySQL面试题深度解析:50道高频真题全解
java·mysql·面试
帝吃藕和10 小时前
MySQL 知识点复习- 2.创建数据表及查询
数据库·mysql
怒放de生命201010 小时前
mysql8安装后忘记密码,大小写不敏感修改,修改端口号,开启远程访问
mysql