MySQL 如何查看表的存储引擎
2017-06-13 09:45 潇湘隐者 阅读(30708) 评论(2) 编辑 收藏 举报MySQL 如何查看表的存储引擎
在MySQL中如何查看单个表的存储引擎? 如何查看整个数据库有那些表是某个特殊存储引擎,例如MyISAM存储引擎呢?下面简单的整理一下这方面的知识点。
如果要查看单个表的存储引擎,可以用show create table命令查看该表的存储引擎,那么有下面一些方法:
方法1:
mysql> show create table test;
+-------+----------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------+
| test | CREATE TABLE `test` (
`id` int(11) DEFAULT NULL,
`name` varchar(12) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+----------------------------------------------+
1 row in set (0.00 sec)
mysql>
方法2:
mysql> show table status from MyDB where name='test' \G
*************************** 1. row ***************************
Name: test
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 0
Avg_row_length: 0
Data_length: 16384
Max_data_length: 0
Index_length: 0
Data_free: 0
Auto_increment: NULL
Create_time: 2017-06-09 15:45:00
Update_time: NULL
Check_time: NULL
Collation: utf8_general_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.01 sec)
方法3:
mysql>
mysql> select table_catalog
-> ,table_schema
-> ,table_name
-> ,engine
-> from tables
-> where table_schema='MyDB' and table_name='test';
+---------------+--------------+------------+--------+
| table_catalog | table_schema | table_name | engine |
+---------------+--------------+------------+--------+
| def | MyDB | test | InnoDB |
+---------------+--------------+------------+--------+
1 row in set (0.00 sec)
mysql>
如果要查询某个库或所有实例里面表使用的存储引擎,那么可以使用information_schema.tables来查询。下面是简单的几个例子。
查询整个MySQL实例里面存储引擎为MyISAM的表
select table_catalog
,table_schema
,table_name
,engine
from information_schema.tables
where engine='MyISAM';
查询MyDB数据库里面存储引擎为MyISAM的表
select table_catalog
,table_schema
,table_name
,engine
from information_schema.tables
where table_schema='MyDB' and engine='MyISAM';

· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· DeepSeek 解答了困扰我五年的技术问题
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
2016-06-13 SQL Server 关于列的权限控制
2014-06-13 Linux系统查看系统是32位还是64位方法总结