查询数据库最大连接数
show variables like \'%max_connections%\';
查询数据库连接超时时间单位(s)
Show variables like ‘wait_timeout’;
查询各个数据库量的大小
select TABLE_SCHEMA,CONCAT(ROUND(SUM(DATA_LENGTH/1024/1024),2),\'MB\') dbsize from information_schema.tables group by TABLE_SCHEMA ;
查询各个数据库量的大小
select TABLE_SCHEMA,CONCAT(ROUND(SUM(DATA_LENGTH/1024/1024),2),\'MB\') dbsize from information_schema.tables group by TABLE_SCHEMA ;
查询指定数据库量的大小
select \'数据库大小\',CONCAT(ROUND(SUM(DATA_LENGTH/1024/1024),2),\'MB\') dbsize from information_schema.tables where table_schema=\'库名\';
查询某个表的大小
select \'表大小\',CONCAT(ROUND(SUM(DATA_LENGTH/1024/1024),2),\'MB\') tbsize
from information_schema.tables
where table_schema=\'库名\' and table_name=\'表名\';
查询各个表的大小
select table_name,\'表大小\',CONCAT(ROUND(SUM(DATA_LENGTH/1024/1024),2),\'MB\') tbsize
from information_schema.tables
where table_schema=\'库名\'
group by table_name=\'表名\';