ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
查询
查询指定库大小
1 2 3 4 5 6 7
-- 使用 information_schema USE information_schema; -- 查看大小 -- 所有数据库 select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES; -- 指定数据库 select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='db_name';
查询指定库所有表的数据量
1 2 3 4 5 6
-- 使用 information_schema USE information_schema; -- 查看每个表的数据量 select table_rows,table_name from tables where table_schema ='db_name'; -- 查看库中所有表的数据量 selectsum(table_rows) from tables where table_schema ='db_name';
查看状态(status)
1 2 3 4
-- 查询本次会话 SHOW SESSION STATUS LIKE'com_%'; #show session status like'Com_select' -- 查看全局 SHOWGLOBAL STATUS LIKE'com_%';
查看变量
1 2 3 4
-- 所有变量 show variables; -- 模糊查询 show variables like'kek%';