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

相关推荐
S***y3962 小时前
MySQL视频
数据库·mysql
小满、3 小时前
MySQL :存储引擎原理、索引结构与执行计划
数据库·mysql·索引·mysql 存储引擎
an__ya__3 小时前
MySQL事务
mysql
大锦终6 小时前
【MySQL】基本查询
数据库·mysql
q***47186 小时前
使用Canal将MySQL数据同步到ES(Linux)
linux·mysql·elasticsearch
避避风港7 小时前
MySQL 从入门到实战
数据库·mysql
q***697711 小时前
Y20030018基于Java+Springboot+mysql+jsp+layui的家政服务系统的设计与实现 源代码 文档
java·spring boot·mysql
q***098011 小时前
MySQL 常用 SQL 语句大全
数据库·sql·mysql
q***498612 小时前
MySQL数据的增删改查(一)
android·javascript·mysql
q***064720 小时前
MySQL的UPDATE(更新数据)详解
数据库·mysql