Mysql常用查询语句荟萃

 memo
 

Mysql查询某个数据库的存储容量

USE information_schema;
SELECT CONCAT(ROUND(SUM(DATA_LENGTH/1024/1024/1024),2),’GB’) AS DATA FROM TABLES WHERE table_schema=’[数据库名]’;

Mysql 设置Profiler功能

SET profiling = 1;

Mysql执行操作

SELECT/EXPLAIN …

Mysql查询各个阶段性能

SHOW PROFILES;
SHOW PROFILE ALL FOR QUERY 1;