当前位置:网站首页>MySQL的存储引擎
MySQL的存储引擎
2022-07-06 20:28:00 【火眼猊】
概念
数据库存储引擎是数据库底层软件组织,数据库管理系统(DBMS)使用数据引擎进行创建、查询、更新和删除数据。
- 不同的存储引擎提供不同的存储机制、索引技巧、锁定水平等功能。现在许多不同的数据库管理系统都支持多种不同的数据引擎。MySQL的核心就是存储引擎
- 用考可以根据不同的需求为数据表选择不同的存储引擎
- 可以使用SHOW ENGINES命令,可以查看MySQL的所有执行引擎,我们可以到默认的执行引擎是innoDB支持事务,行级锁定和外键。
分类
- CSV:逻辑上由逗号粉哥数据的存储引擎。特惠在数据库子目录里为每个数据表创建一个.csv文件。这是一种普通文本文件,每个数据行占用一个文本行。CSV存储引擎不支持索引。
- BlackHole:黑洞引擎,写入的任何数据都会消失,一般用于记录binlog做复制的中继
- ERFORMANCE_SCHEMA存储引擎:该引擎主要用于手机数据库服务器性能参数。
- Mrg_Myisam Merge存储引擎:是一组Mylsam的组合,也就是说,他将Myisam引擎的多个表聚合起来,但是他的内部没有数据,真正的数据依然是Myisam引擎的表中,但是可以直接进行查询、删除更新等操作。
| 功能 | MyISAM | MEMORY | InnoDB |
|---|---|---|---|
| 存储限制 | 256TB | RAM | 64TB |
| 支持事务 | No | No | Yes |
| 支持全文索引 | Yes | No | No |
| 支持B树索引 | Yes | Yes | Yes |
| 支持哈希索引 | No | Yes | No |
| 支持集群索引 | No | No | Yes |
| 支持数据索引 | No | Yes | Yes |
| 支持数据压缩 | Yes | No | No |
| 空间支持率 | 低 | N/A | 高 |
| 支持外键 | No | No | Yes |
操作
查询当前数据库支持的存储引擎
方法:
SHOW ENGINES;
查看当前默认存储引擎.
方法:
SHOW VARIABLES LIKE '%storage_engine%';
查看某个表用了什么引擎(在现实结果里参数engine后面的就表示当前用的存储引擎)
方法:
SHOW CREATE TABLE table_name;
创建新表时指定存储引擎
方法:
CREATE TABLE(...) ENGINE = MYISAM;
修改数据库引擎
方法:
ALTER TABLE table_name ENGINE = MYISAM;
ALTER TABLE table_name ENGINE = InnoDB;
修改MySQL默认存储引擎
- 关闭MySQL服务
- 找到MySQL服务安装目录下的my.ini文件
- 找到default-storage-engine=INNODB改为目标引擎
- 启动MySQL服务
边栏推荐
- Jerry's RTC clock development [chapter]
- Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]
- About Tolerance Intervals
- Flutter3.0了,小程序不止于移动应用跨端运行
- [Dameng database] after backup and recovery, two SQL statements should be executed
- 1200.Minimum Absolute Difference
- 22. (ArcGIS API for JS) ArcGIS API for JS Circle Collection (sketchviewmodel)
- Ubuntu 20 installation des enregistrements redisjson
- 「小样本深度学习图像识别」最新2022综述
- Tencent cloud native database tdsql-c was selected into the cloud native product catalog of the Academy of communications and communications
猜你喜欢

When you go to the toilet, you can clearly explain the three Scheduling Strategies of scheduled tasks

源代码保密的意义和措施

枚举通用接口&枚举使用规范

About Tolerance Intervals

HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅

哈夫曼树基本概念

我的勇敢对线之路--详细阐述,浏览器输入URL发生了什么

Under the tide of "going from virtual to real", Baidu AI Cloud is born from real

23.(arcgis api for js篇)arcgis api for js椭圆采集(SketchViewModel)

Experience design details
随机推荐
制作(转换)ico图标
Depth analysis of compilation constants, classloader classes, and system class loaders
Room rate system - login optimization
Can the applet run in its own app and realize live broadcast and connection?
ubuntu20安裝redisjson記錄
[C language] question set of IX
22.(arcgis api for js篇)arcgis api for js圆采集(SketchViewModel)
[swift] learning notes (I) -- familiar with basic data types, coding styles, tuples, propositions
Decoration design enterprise website management system source code (including mobile source code)
Under the tide of "going from virtual to real", Baidu AI Cloud is born from real
Open3d mesh filtering
Codeforces round 264 (Div. 2) C gargari and Bishop [violence]
20. (ArcGIS API for JS) ArcGIS API for JS surface collection (sketchviewmodel)
[cpk-ra6m4 development board environment construction based on RT thread studio]
“去虚向实”大潮下,百度智能云向实而生
Enumeration general interface & enumeration usage specification
【DPDK】dpdk样例源码解析之三:dpdk-l3fwd_001
海思3559万能平台搭建:RTSP实时播放的支持
Do you know the five most prominent advantages of E-bidding?
Create applet from 0