[+/-]
SHOW BINARY LOGS
SyntaxSHOW BINLOG EVENTS
SyntaxSHOW CHARACTER SET
SyntaxSHOW COLLATION
SyntaxSHOW COLUMNS
SyntaxSHOW CREATE DATABASE
SyntaxSHOW CREATE TABLE
SyntaxSHOW DATABASES
SyntaxSHOW ENGINE
SyntaxSHOW ENGINES
SyntaxSHOW ERRORS
SyntaxSHOW GRANTS
SyntaxSHOW INDEX
SyntaxSHOW INNODB STATUS
SyntaxSHOW LOGS
SyntaxSHOW MASTER STATUS
SyntaxSHOW OPEN TABLES
SyntaxSHOW PRIVILEGES
SyntaxSHOW PROCESSLIST
SyntaxSHOW SLAVE HOSTS
SyntaxSHOW SLAVE STATUS
SyntaxSHOW STATUS
SyntaxSHOW TABLE STATUS
SyntaxSHOW TABLES
SyntaxSHOW VARIABLES
SyntaxSHOW WARNINGS
Syntax
SHOW
has many forms that provide
information about databases, tables, columns, or status
information about the server. This section describes those
following:
SHOW CHARACTER SET [LIKE 'pattern
'] SHOW COLLATION [LIKE 'pattern
'] SHOW [FULL] COLUMNS FROMtbl_name
[FROMdb_name
] [LIKE 'pattern
'] SHOW CREATE DATABASEdb_name
SHOW CREATE TABLEtbl_name
SHOW DATABASES [LIKE 'pattern
'] SHOW ENGINEengine_name
{LOGS | STATUS } SHOW [STORAGE] ENGINES SHOW ERRORS [LIMIT [offset
,]row_count
] SHOW GRANTS FORuser
SHOW INDEX FROMtbl_name
[FROMdb_name
] SHOW INNODB STATUS SHOW [BDB] LOGS SHOW PRIVILEGES SHOW [FULL] PROCESSLIST SHOW [GLOBAL | SESSION] STATUS [LIKE 'pattern
'] SHOW TABLE STATUS [FROMdb_name
] [LIKE 'pattern
'] SHOW [OPEN] TABLES [FROMdb_name
] [LIKE 'pattern
'] SHOW [GLOBAL | SESSION] VARIABLES [LIKE 'pattern
'] SHOW WARNINGS [LIMIT [offset
,]row_count
]
If the syntax for a given SHOW
statement includes a LIKE
'
part,
pattern
''
is a
string that can contain the SQL
“pattern
'%
” and
“_
” wildcard characters. The
pattern is useful for restricting statement output to matching
values.
Many MySQL APIs (such as PHP) allow you to treat the result
returned from a SHOW
statement as
you would a result set from a
SELECT
; see
Chapter 17, Connectors and APIs, or your API documentation for
more information.
User Comments
A note on privileges
The privileges of the SHOW command appear to derive from those of SELECT.
If the user has SELECT privileges, then SHOW will be successful, and if not, will
be unsuccessful, with an error message, viz:
mysql> show tables in mysql;
ERROR 1044 (42000): Access denied for user 'user'@'localhost' to database 'mysql'
Another way to look at this connection: SHOW is a shorthand for SELECT.
It appears that DESCRIBE is also a shorthand for SELECT and derives its
privileges from that command.
Add your own comment.