Answers:
您可以像这样检查每个表:
USE <database>;
SHOW TABLE STATUS\G
您将获得以下内容的输出:
root@localhost/database> show table status\G
*************************** 1. row ***************************
Name: tablename
Engine: MyISAM
Version: 10
Row_format: Fixed
Rows: 101
Avg_row_length: 70
Data_length: 7070
Max_data_length: 19703248369745919
Index_length: 2048
Data_free: 0
Auto_increment: 1004
Create_time: 2009-12-07 20:15:53
Update_time: 2010-11-10 21:55:01
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
该查询列出了MySQL中的所有InnoDB表及其数据库:
SELECT table_name, table_schema
FROM information_schema.tables
WHERE engine = 'InnoDB';
您还可以列出所有表及其存储引擎:
SELECT table_name, table_schema, engine
FROM information_schema.tables;
ERROR 1146 (42S02): Table 'information_scheme.tables' doesn't exist
在MySQL 5.6.37上)
SHOW TABLE
为数据库中的每个表编写脚本之外)?