Official document address: 13.7.7.39 SHOW TABLES Statement
SHOW [EXTENDED] [FULL] TABLES
[{
FROM | IN} db_name]
[LIKE 'pattern' | WHERE expr]
SHOW TABLES
List the non-temporary tables in the given database. You can also use the mysqlshow db_name
command to get this list. If there is a LIKE
clause, it indicates which table names to match. You can also use WHERE
clauses to select rows using more general conditions, as discussed in 26.55 SHOW Statement Extension .
LIKE
The matching performed by the clause depends on lower_case_table_names
the setting of the system variable.
The optional EXTENDED
modifier causes the hidden table created by the SHOW TABLES
failed ALTER TABLE
statement to be listed . The names of these temporary tables #sql
start with, and you can use DROP TABLE
them to delete them.
This statement can also list any view in the database. The optional FULL
modifier causes the SHOW TABLES
second output column to be displayed, with values including BASE TABLE
(representing a table), VIEW
(representing a view), SYSTEM VIEW
(representing a INFORMATION_SCHEMA table).
If you do not have permission to view the base table or view, it will not be displayed in the output of SHOW TABLES
or mysqlshow db_name
.
You can also INFORMATION_SCHEMA
TABLES
get table information from the table. See 26.38 INFORMATION_SCHEMA TABLES table .