当前位置:网站首页>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 <数据库名>
边栏推荐
- “顶梁柱”滑坡、新增长极难担重任,阿里“蹲下”是为了跳更高?
- Pinduoduo store business license related issues
- js uses the string as the js execution code
- MYSQLg高级------聚簇索引和非聚簇索引
- App Basic Framework Construction丨Log Management - KLog
- 阿里云发布3大高性能计算解决方案
- E-commerce project - mall time-limited seckill function system
- FTP错误代码列表
- Enter the starting position, the ending position intercepts the linked list
- 程序化交易与主观交易对盈利曲线的影响!
猜你喜欢

CTO said that the number of rows in a MySQL table should not exceed 2000w, why?

Build Zabbix Kubernetes cluster monitoring platform

Differences and connections between distributed and clustered

DNS separation resolution and intelligent resolution

【FPGA】day22-SPI协议回环

Echart地图的省级,以及所有地市级下载与使用

es-head plugin insert query and conditional query (5)

你不知道的 console.log 替代品

【FPGA】day21- moving average filter

云平台下ESB产品开发步骤说明
随机推荐
Qnet弱网测试工具操作指南
使用jackson解析json数据详讲
What problems should we pay attention to when building a programmatic trading system?
常见布局效果实现方案
机器学习怎么学?机器学习流程
typedef defines the structure array type
论文精度 —— 2017 CVPR《High-Resolution Image Inpainting using Multi-Scale Neural Patch Synthesis》
【FPGA】day20-I2C读写EEPROM
What are port 80 and port 443?What's the difference?
Day20 FPGA 】 【 - block the I2C read and write EEPROM
Is there any way for kingbaseES to not read the system view under sys_catalog by default?
拼多多店铺营业执照相关问题
Basic understanding of MongoDB (2)
高度塌陷问题的解决办法
The "top pillar" slides, and new growth is extremely difficult to shoulder the heavy responsibility. Is Ali "squatting" to jump higher?
电力机柜数据监测RTU
Design and Realization of Employment Management System in Colleges and Universities
Build Zabbix Kubernetes cluster monitoring platform
STC8H development (15): GPIO drive Ci24R1 wireless module
Homework 8.10 TFTP protocol download function