SHOW
具有许多形式,可提供有关数据库,表,列或有关服务器的状态信息的信息。
SHOW {BINARY | MASTER} LOGS #显示二进制文件 SHOW BINLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count] SHOW CHARACTER SET [like_or_where] SHOW COLLATION [like_or_where] SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where] SHOW CREATE DATABASE db_name #显示创建数据库语句 SHOW CREATE EVENT event_name #显示创建事件语句 SHOW CREATE FUNCTION func_name SHOW CREATE PROCEDURE proc_name SHOW CREATE TABLE tbl_name #显示创建表 SHOW CREATE TRIGGER trigger_name SHOW CREATE VIEW view_name SHOW DATABASES [like_or_where] SHOW ENGINE engine_name {STATUS | MUTEX} #显示存储引擎 SHOW [STORAGE] ENGINES SHOW ERRORS [LIMIT [offset,] row_count] SHOW EVENTS SHOW FUNCTION CODE func_name SHOW FUNCTION STATUS [like_or_where] SHOW GRANTS FOR user #显示用户权限 SHOW INDEX FROM tbl_name [FROM db_name] SHOW MASTER STATUS #显示主库状态 SHOW OPEN TABLES [FROM db_name] [like_or_where] SHOW PLUGINS #显示插件 SHOW PROCEDURE CODE proc_name SHOW PROCEDURE STATUS [like_or_where] SHOW PRIVILEGES #查看权限表; SHOW [FULL] PROCESSLIST SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n] SHOW PROFILES SHOW RELAYLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count] SHOW SLAVE HOSTS # SHOW SLAVE STATUS [FOR CHANNEL channel] #查看 SHOW [GLOBAL | SESSION] STATUS [like_or_where] SHOW TABLE STATUS [FROM db_name] [like_or_where] SHOW [FULL] TABLES [FROM db_name] [like_or_where] SHOW TRIGGERS [FROM db_name] [like_or_where] SHOW [GLOBAL | SESSION] VARIABLES [like_or_where] SHOW WARNINGS [LIMIT [offset,] row_count] like_or_where: { LIKE 'pattern' | WHERE expr }
show index from table #显示表的索引信息,主要字段Cardinality显示索引中不重复记录数量的预估值。