可以使用SHOW FULL TABLES语句完成。它的语法如下:
SHOW FULL TABLES
在下面的示例中,当前数据库为“查询”,因此下面的语句将向我们显示该数据库结果集中的表列表以及表类型-
mysql> SHOW FULL TABLES; +-----------------------------+------------+ | Tables_in_query | Table_type | +-----------------------------+------------+ | accounts | BASE TABLE | | address | BASE TABLE | | cars | BASE TABLE | | cars_avgprice | VIEW | | countries | BASE TABLE | | customer_view | VIEW | | customers | BASE TABLE | | date_time_test | BASE TABLE | | detail_bday | BASE TABLE | | details_city | BASE TABLE | . . . | view_student_detail | VIEW | | view_student_detail_columns | VIEW | | websites | BASE TABLE | +-----------------------------+------------+ 87 rows in set (0.01 sec)
以上结果集显示了表以及表类型,即它是BASE TABLE还是VIEW。