跳到主要内容
版本:latest

GetDbStatus

获取 MySQL 运行时的内存相关配置参数,通过解析 /etc/my.cnfSHOW VARIABLES 获得。

  • 路由POST /database
  • actionGetDbStatus

输入参数

参数名称必选类型描述
actionString固定值 GetDbStatus

输出参数

返回 mem 对象,包含以下 MySQL 配置项:

参数名称类型描述
query_cache_sizeString查询缓存大小
bt_query_cache_sizeString面板设置的查询缓存
query_cache_typeString查询缓存类型:ON / OFF / DEMAND
query_cache_supprotString查询缓存支持状态
table_open_cacheInteger打开表缓存数量
thread_cache_sizeInteger线程缓存大小
key_buffer_sizeIntegerMyISAM 索引缓冲(MB)
tmp_table_sizeInteger临时表大小(MB)
max_heap_table_sizeStringMEMORY 表最大大小
innodb_buffer_pool_sizeIntegerInnoDB 缓冲池大小(MB)
innodb_log_buffer_sizeIntegerInnoDB 日志缓冲(MB)
max_connectionsInteger最大连接数
sort_buffer_sizeInteger排序缓冲(KB)
read_buffer_sizeInteger读缓冲(KB)
read_rnd_buffer_sizeInteger随机读缓冲(KB)
join_buffer_sizeIntegerJOIN 缓冲(KB)
thread_stackInteger线程栈大小(KB)
binlog_cache_sizeIntegerBinlog 缓存(KB)

示例

{
"mem": {
"query_cache_size": "0",
"bt_query_cache_size": "0",
"table_open_cache": 256,
"thread_cache_size": 32,
"query_cache_type": "OFF",
"key_buffer_size": 64,
"tmp_table_size": 64,
"max_heap_table_size": "16777216",
"innodb_buffer_pool_size": 256,
"innodb_log_buffer_size": 32,
"max_connections": 500,
"sort_buffer_size": 1024,
"read_buffer_size": 1024,
"read_rnd_buffer_size": 256,
"join_buffer_size": 256,
"thread_stack": 256,
"binlog_cache_size": 32,
"query_cache_supprot": "disable"
}
}