当前位置:网站首页>MySQL database storage engine and database creation, modification and deletion
MySQL database storage engine and database creation, modification and deletion
2022-08-11 03:53:00 【1 + 1 = king】
MySQL存储引擎
InnoDB存储引擎
InnoDB存储引擎是MySQLCommon storage engine,
- 它给MySQL的表提供了事务处理、回滚、Features like crash fixes and multi-version concurrency control;
- Support column value auto-increment(Column values cannot be null and must be unique);
- 支持外键.
- 缺点: The space occupied is relatively large
MyISAM储存引擎
MyISAMStorage engine support3种不同的存储格式:静态型、动态型和压缩型.
- 静态型:静态型是MyISAM的默认存储格式,Its fields are fixed length;
- 动态型:包含变长字段,记录的长度不是固定的.
MyISAMThe storage engine takes up little space,处理速度快;However, transaction integrity and concurrency are not supported.
Memory存储引擎
MemoryThe storage engine uses what is stored in memory to create tables,And the data is all stored in memory.
每个基于Memory存储引擎的表实际对应一个磁盘文件,The file name is the same as the table name,And only store the structure of the table.如果重启或关机,所有数据都会消失.
Memory存储引擎默认使用哈希索引,It can also be specified as when creating the indexB型树索引,Using a hash index is faster than using Btype tree index is fast.
Archive存储引擎
Archive存储引擎只支持INSERT和SELECT操作,非常适合存储归档数据,such as log information.
Archivestorage engine by usingzlib算法将数据行压缩后存储,But it doesn't know about transaction-safe storage engines,It was designed to provide high-speed insertion and compression.
功能 | InnoDB | MyISAM | Memory | Archive |
---|---|---|---|---|
存储限制 | <= 64TB | <=256TB | RAM | None |
支持事务 | 是 | 否 | 否 | 否 |
全文索引 | 否 | 是 | 否 | 否 |
树索引 | 是 | 是 | 是 | 否 |
哈希索引 | 否 | 否 | 是 | 否 |
数据缓存 | 是 | 否 | N/A | 否 |
外键 | 是 | 否 | 否 | 否 |
数据库的相关操作
创建数据库
create database [if not exists] <数据库名>
[[default] charset set <字符集名>]
[[default] collate <校对规则名>]
- [if not exists]:Indicates whether the database exists before creating the database,The create operation is performed only if the data does not exist
- [[default] charset set <字符集名>]:Represents the character set of the specified database.
- [[default] collate <校对规则名>]:Indicates the default collation for the specified character set.
修改数据库
alter database <数据库名> {
[default] charset set <字符集名> |
[default] collate <校对规则名> }
使用alter databaseChange the global properties of the database,You need to obtain permission to modify the database in advance.
删除数据库
drop database [if exists] <数据库名>
查看数据库列表
show databases [like '数据库名'];
用户查看MySQLA list of databases that currently exist in .
[like ‘数据库名’]:User matches the specified database name,It can be a partial match or an exact match.
打开数据库
use <数据库名>
边栏推荐
- 【FPGA】day21- moving average filter
- [yu gong series] Go program 035-08 2022 interfaces and inheritance and transformation and empty interface
- STC8H development (15): GPIO drive Ci24R1 wireless module
- 【FPGA】day18-ds18b20实现温度采集
- 程序化交易的策略类型可以分为哪几种?
- Watch to monitor
- Multi-merchant mall system function disassembly 26 lectures - platform-side distribution settings
- 2022-08-10 The sixth group Hiding spring study notes
- Element's BFC attribute
- uni-app - city selection index list / city list sorted by A-Z (uview component library IndexList index list)
猜你喜欢
【FPGA】SDRAM
【FPGA】设计思路——I2C协议
When EasyCVR is connected to the GB28181 device, what is the reason that the device is connected normally but the video cannot be played?
Interchangeability and Measurement Techniques - Tolerance Principles and Selection Methods
什么是机器强化学习?原理是什么?
es-head插件插入查询以及条件查询(五)
The custom of the C language types -- -- -- -- -- - structure
Interchangeability and Measurement Technology—Surface Roughness Selection and Marking Method
机器学习可以应用在哪些场景?机器学习有什么用?
"110 Balanced Binary Tree Judgment" in leetCode's 14-day binary tree series
随机推荐
A large horse carries 2 stone of grain, a middle horse carries 1 stone of grain, and two ponies carry one stone of grain. It takes 100 horses to carry 100 stone of grain. How to distribute it?
Pinduoduo store business license related issues
什么是机器强化学习?原理是什么?
Will oracle cardinality affect query speed?
Element's BFC attribute
LeetCode Brush Questions Day 11 String Series "58 Last Word Length"
How can users overcome emotional issues in programmatic trading?
使用jackson解析json数据详讲
Multi-merchant mall system function disassembly 26 lectures - platform-side distribution settings
2022-08-10 The sixth group Hiding spring study notes
C language recv() function, recvfrom() function, recvmsg() function
AI+医疗:使用神经网络进行医学影像识别分析
"110 Balanced Binary Tree Judgment" in leetCode's 14-day binary tree series
Rotary array problem: how to realize the array "overall reverse, internal orderly"?"Three-step conversion method" wonderful array
云平台下ESB产品开发步骤说明
LeetCode814算题第15天二叉树系列值《814 二叉树剪枝》
【FPGA】day22-SPI protocol loopback
Build Zabbix Kubernetes cluster monitoring platform
What is Machine Reinforcement Learning?What is the principle?
QueryDet:级联稀疏query加速高分辨率下的小目标检测