查看table的存储引擎
show create table producttype;
CREATE TABLE `producttype` (
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`typeId`)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8
修改表的存储引擎
alter table tablename engine=innodb
修改默认存储引擎 配置文件my.ini
default-storage-engine=INNODB
《High Performance MySQL》 中的各存储引擎的特性表
|
Attribute |
MyISAM |
Heap |
BDB |
InnoDB |
|---|---|---|---|---|
|
Transactions |
No |
No |
Yes |
Yes |
|
Lock granularity |
Table |
Table |
Page (8 KB) |
Row |
|
Storage |
Split files |
In-memory |
Single file per table |
Tablespace(s) |
|
Isolation levels |
None |
None |
Read committed |
All |
|
Portable format |
Yes |
N/A |
No |
Yes |
|
Referential integrity |
No |
No |
No |
Yes |
|
Primary key with data |
No |
No |
Yes |
Yes |
|
MySQL caches data records |
No |
Yes |
Yes |
Yes |
|
Availability |
All versions |
All versions |
MySQL-Max |
All Versions |
本文介绍如何查看及修改MySQL中表的存储引擎,包括使用SQL语句查看特定表的存储引擎类型,通过ALTER TABLE语句更改存储引擎,以及在my.ini配置文件中设置默认存储引擎。此外,还对比了不同存储引擎如MyISAM、InnoDB等的特点。

被折叠的 条评论
为什么被折叠?



