1.存储引擎
完整的建表语句:
CREATE TABLE dept
(
DEPTNO
int(2) NOT NULL,
DNAME
varchar(14) DEFAULT NULL,
LOC
varchar(13) DEFAULT NULL,
PRIMARY KEY (DEPTNO
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
InnoDB是存储引擎
show engines \G; 查看mysql支持的存储引擎
(1)myisam存储引擎,不支持事务
使用这种引擎,一张表由三个文件组成。
.frm(存储表结构),.myd(存储数据),.myi(存储索引)
特点:节省空间,可被压缩。可以转换为只读表,检索效率高
(2)innodb
该存储引擎支持事务,相对安全,并且具有行级锁和外键。
[En]
This storage engine supports transactions, is relatively secure, and has row-level locks and foreign keys.
表的结构存储在.frm,数据存储在tablespace中。
无法压缩或转换为只读文件
[En]
Cannot be compressed or converted to a read-only file
在数据库崩溃时提供自动恢复机制。
[En]
Provide an automatic recovery mechanism if the database crashes.
支持级联删除和级联更新。
[En]
Cascading deletions and cascading updates are supported.
(3)memory
这种存储引擎数据索引在内存中读书速度很快,但不支持事务,不安全。
[En]
This kind of storage engine data index is very fast to read books in memory, but does not support transactions and is not safe.
Original: https://www.cnblogs.com/journeyhch/p/15568778.html
Author: journeyhch
Title: mysql-存储引擎
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/508032/
转载文章受原作者版权保护。转载请注明原作者出处!