如何知道 MySQL 表使用的是 myISAM 还是 InnoDB 引擎?
mysqlmysqli database更新于 2024/12/28 14:04:17
要知道 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;
以下是显示所有引擎的输出 −

相关文章
有用资源
mysql 参考教程 - 该教程包含有关 mysql 的更多信息:https://www.cainiaomax.com/mysql/

