当前位置:网站首页>How MySQL modifies the storage engine to InnoDB
How MySQL modifies the storage engine to InnoDB
2022-06-22 15:22:00 【Yisu cloud】
mysql How to modify the storage engine to innodb
This article mainly introduces “mysql How to modify the storage engine to innodb”, In daily operation , I believe a lot of people are mysql How to modify the storage engine to innodb There are doubts about the problem , Xiao Bian consulted all kinds of materials , Sort out simple and easy-to-use operation methods , I hope to answer ”mysql How to modify the storage engine to innodb” Your doubts help ! Next , Please follow Xiaobian to learn !
Two ways to modify :1、 Use SET Statement to temporarily modify the default storage engine , The grammar is “SET default_storage_engine=innodb;”, When the client is restarted, it will revert to the original engine type .2、 Use ALTER TABLE Statement modification , grammar “ALTER TABLE Table name ENGINE=innodb;”, You can change the engine type of the specified table to innodb.
The operating environment of this tutorial :windows7 System 、mysql8 edition 、Dell G3 The computer .
mysql Modify the storage engine to innodb Two methods of
1、 Use SET Statement temporary modification
Use the following statement to modify the default storage engine of the temporary database :
SET default_storage_engine=< Storage engine name >
Example : Modify the default storage engine to innodb
SET default_storage_engine=innodb;

here , You can find MySQL The default storage engine for has become InnoDB. But when the client is restarted, it will revert to the original engine type .
notes : stay MySQL 5.5 Before , When you create a table without explicitly specifying the storage engine ,MyISAM Is the default storage engine . From version 5.5 Start ,MySQL Use InnoDB As the default storage engine .
2、 Use ALTER TABLE Statement modification
MySQL The syntax format of the storage engine that modifies the data table in is as follows :
ALTER TABLE < Table name > ENGINE=< Storage engine name >;
ENGINE Keyword is used to indicate the new storage engine .
Examples demonstrate
Data table contacts The storage engine of is changed to InnoDB.
Before modifying the storage engine , First use SHOW CREATE TABLE Statement view contacts Table current storage engine
SHOW CREATE TABLE contacts \G

You can see ,contacts The current storage engine of the table is MyISAM.
Next contacts The storage engine of the table is modified to InnoDB type ,SQL Statement for :
ALTER TABLE contacts ENGINE=InnoDB;
Use SHOW CREATE TABLE Statement view again contacts Table storage engine , Will find contacts The storage engine for tables becomes “InnoDB”

Here we are , About “mysql How to modify the storage engine to innodb” That's the end of my study , I hope we can solve your doubts . The combination of theory and practice can better help you learn , Let's try ! If you want to continue to learn more related knowledge , Please continue to pay attention to Yisu cloud website , Xiaobian will continue to strive to bring you more practical articles !
边栏推荐
- 2022orace database installation and use
- Good wind relies on strength – code conversion practice of accelerating SQL Server Migration with babelfish
- C language student management system (open source)
- U++编程 数组学习笔记
- Common operations in Visual Studio development
- PowerPoint 教程,如何在 PowerPoint 中添加水印?
- We will resolutely fight and win the hard battle of flood control and disaster relief and spare no effort to ensure the safety of people's lives and property
- 拜登簽署兩項旨在加强政府網絡安全的新法案
- 接了个私活项目,一下赚了15250,还有必要做主业吗?
- After 100 days, Xiaoyu built a robot communication community!! Now invite moderators!
猜你喜欢

个人免签支付方案推荐

擴散模型又殺瘋了!這一次被攻占的領域是...

树结构二叉树

PowerPoint tutorial, how to add watermarks in PowerPoint?

PHP内置协议(支持的协议和封装协议)

Data collection: skillfully using Bloom filter to extract data summary

All famous network platforms in the world

NF-ResNet:去掉BN归一化,值得细读的网络信号分析 | ICLR 2021

Fluentd is easy to get started. Combined with the rainbow plug-in market, log collection is faster

Biden signs two new laws aimed at strengthening government cyber security
随机推荐
[Software Engineering] design module
Fight, programmer chapter 43 kill one man in ten steps
mysql的concat()函数如何用
阿里云发布CIPU,对于企业客户意味着什么?
MySQL learning notes 2022
All famous network platforms in the world
Using virtual serial port to debug serial port in keil MDK
求求了,别被洗脑了,这才是90%中国人的生存实况
Database connection pool: stress testing
Follow up to the "June 21" gas explosion accident in Tai'an, Shandong Province: comprehensive investigation and remediation of potential gas safety hazards in restaurants
NF-ResNet:去掉BN归一化,值得细读的网络信号分析 | ICLR 2021
Can Google bidding account detect the global market?
KEIL仿真和vspd
U++ 运营商 学习笔记
那些没考上大学的人,后来过的怎样
Is the encryption market a "natural disaster" or a "man-made disaster" in the cold winter?
U++编程 数组学习笔记
What is the value of a website? Why build an independent station
【毕业设计】基于半监督学习和集成学习的情感分析研究
Struggle, programmer -- Chapter 47 the so-called Iraqis are on the water side