SHOW Syntax

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

转载于:https://www.cnblogs.com/zhengwenqiang/p/8878100.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值