MySQL 5.5 Reference Manual /
SHOW OPEN TABLES Syntax
列出当前打开在表缓存的非临时表,from从句可用来限制不同数据库 like 限制表名 where从句可用选择行
show open tables where In_use>=1 and Name_locked=0;
In_use 表锁和锁请求的数量
SHOW BINARY LOGS Syntax
查看二进制logs的文件名字及大小
SHOW BINARY LOGS 等于 SHOW MASTER LOGS
在5.5.24之前,需要SUPER权限。5.5.25开始,具有REPLICATION_CLIENT权限也可以执行此查询。
SHOW PROFILE Syntax
查看SQL执行概要
-- https://dev.mysql.com/doc/refman/5.5/en/show-profile.html
-- Malformed statements are profiled.
select @@profiling;
select count(1) from statisticsdata.activityEvent;
show profiles;
show profile all for query 86;
select state, format(duration, 6) as duration from INFORMATION_SCHEMA.PROFILING where QUERY_ID = 86 order by SEQ;
desc information_schema.profiling;
一些show语句支持where、like 从句查询,限制结果集数量
show status where Variable_name = 'Uptime';
show status where Variable_name like '%Uptime%';
这些show语句分别是
show character set
show collation
show columns
show databases
show function status
show index
show open tables
show procedure status
show status
show table status
show tables
show triggers
show variables