Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> MySQL

Xem danh sách bảng của database khác kèm loại bảng (SHOW FULL TABLES FROM)

Dùng SHOW FULL TABLES FROM db_name để liệt kê bảng kèm loại (BASE TABLE/VIEW) từ database khác database hiện tại.

Cú pháp

SHOW FULL TABLES FROM db_name

Ví dụ: Đang ở DB 'query', xem bảng của DB 'mysql'

mysql> SHOW FULL TABLES FROM mysql;
+---------------------------+------------+
| Tables_in_mysql           | Table_type |
+---------------------------+------------+
| arena                     | BASE TABLE |
| arena1                    | BASE TABLE |
| columns_priv              | BASE TABLE |
| dates                     | VIEW       |
| dates1                    | VIEW       |
| db                        | BASE TABLE |
| digits                    | VIEW       |
| engine_cost               | BASE TABLE |
| event                     | BASE TABLE |
| func                      | BASE TABLE |
| general_log               | BASE TABLE |
| gtid_executed             | BASE TABLE |
| help_category             | BASE TABLE |
| help_keyword              | BASE TABLE |
| help_relation             | BASE TABLE |
| help_topic                | BASE TABLE |
| innodb_index_stats        | BASE TABLE |
| innodb_table_stats        | BASE TABLE |
| ndb_binlog_index          | BASE TABLE |
| numbers                   | VIEW       |
| plugin                    | BASE TABLE |
| proc                      | BASE TABLE |
| procs_priv                | BASE TABLE |
| proxies_priv              | BASE TABLE |
| server_cost               | BASE TABLE |
| servers                   | BASE TABLE |
| slave_master_info         | BASE TABLE |
| slave_relay_log_info      | BASE TABLE |
| slave_worker_info         | BASE TABLE |
| slow_log                  | BASE TABLE |
| tables_priv               | BASE TABLE |
| test_date                 | BASE TABLE |
| time_zone                 | BASE TABLE |
| time_zone_leap_second     | BASE TABLE |
| time_zone_name            | BASE TABLE |
| time_zone_transition      | BASE TABLE |
| time_zone_transition_type | BASE TABLE |
| user                      | BASE TABLE |
+---------------------------+------------+

Table_type: BASE TABLE (bảng thường) hoặc VIEW.