如何知道 MySQL 表是使用 myISAM 还是 InnoDB 引擎?
要了解 MySQL 表是使用 MyISAM 还是 InnoDB 引擎,你可以使用命令 show status table。以下是语法:-
SHOW TABLE STATUS from yourDatabaseName LIKE ‘yourTableName’.
以上语法说明了特定的表引擎。现在你可以应用以上语法来了解 MySQL 表引擎是使用 MyISAM 还是 InnoDB。
此处,我有数据库“business”和表“student”。查询如下:-
mysql> show table status from business like 'student';
以下是显示表“student”正在使用的引擎的内容:-
+---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | student | InnoDB | 10 | Dynamic | 2 | 8192 | 16384 | 0 | 32768 | 0 | NULL | 2018-10-01 12:26:57 | NULL | NULL | utf8mb4_unicode_ci | NULL | | | +---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ 1 row in set (0.09 sec)
要了解所有表的引擎类型,你可以使用以下语法:-
SHOW TABLE STATUS FROM yourDatabaseName;
在以下查询中应用以上语法:-
mysql> show table status from business;
以下是显示所有引擎的输出:-
广告