Syntax
Supplement
- When
databaseName
is not specified, the default is the currently used DATABASE
. If DATABASE
is not used, No database selected
will be prompted.
- Query matadata of multiple tables from specified database
SHOW TABLE METADATA t_order, t_order_1 FROM sharding_db;
mysql> SHOW TABLE METADATA t_order, t_order_1 FROM sharding_db;
+-------------------+------------+--------+----------+
| schema_name | table_name | type | name |
+-------------------+------------+--------+----------+
| sharding_db | t_order_1 | COLUMN | order_id |
| sharding_db | t_order_1 | COLUMN | user_id |
| sharding_db | t_order_1 | INDEX | PRIMARY |
| sharding_db | t_order | COLUMN | order_id |
| sharding_db | t_order | COLUMN | status |
| sharding_db | t_order | INDEX | PRIMARY |
+-------------------+------------+--------+----------+
8 rows in set (0.01 sec)
- Query metadata of one table from specified database
mysql> SHOW TABLE METADATA t_order FROM sharding_db;
+-------------------+------------+--------+----------+
| schema_name | table_name | type | name |
+-------------------+------------+--------+----------+
| sharding_db | t_order | COLUMN | order_id |
| sharding_db | t_order | COLUMN | user_id |
| sharding_db | t_order | COLUMN | status |
| sharding_db | t_order | INDEX | PRIMARY |
4 rows in set (0.00 sec)
- Query metadata of multiple tables from current database
- Query metadata of one table from current database
SHOW TABLE METADATA t_order;
mysql> SHOW TABLE METADATA t_order;
+-------------------+------------+--------+----------+
| schema_name | table_name | type | name |
+-------------+------------+--------+----------+
| sharding_db | t_order | COLUMN | order_id |
| sharding_db | t_order | COLUMN | user_id |
| sharding_db | t_order | COLUMN | status |
| sharding_db | t_order | INDEX | PRIMARY |
+-------------------+------------+--------+----------+
4 rows in set (0.01 sec)
Reserved word