如何知道 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;

以下是顯示所有引擎的輸出:-

更新於: 2020 年 6 月 26 日

3K+ 瀏覽

開啟你的職業生涯

完成課程獲得認證

開始
廣告