Change the MySQL database engine to InnoDB

Change the MySQL database engine to InnoDB

PS: I use PHPStudy2016 here

1. Stop MySQL during modification

2. Modify my.ini

default-storage-engine=INNODB

3. After modification, delete the log files starting with ib under D:\phpStudy\MySQL\data

4. Start MySQL

After setting up, use Navicat to create a new database with the same encoding as the target database, and then copy it over. The data engine of the copied data table is consistent with the data engine of the source data table.

Note: Modify the data table engine

alter table tableName type=InnoDB

Supplement: InnoDB and MyISAM engine selection and change the default engine

MySQL database changes the default engine to Innodb [Configuration]

InnoDB and MyISAM are the two most commonly used table types by many people when using MySQL. These two table types have their own advantages and disadvantages, depending on the specific application.

The basic difference is that the MyISAM type does not support advanced processing such as transaction processing, while the InnoDB type does. MyISAM type tables emphasize performance and execute faster than InnoDB type, but do not provide transaction support. InnoDB provides transaction support and advanced database features such as external keys.

Why do I need to change the default engine? The reason is actually very simple. The default MySQL engine I use is MyISAM, and MyISAM does not support transaction processing, so I need to change its engine.

To change the default MySQL engine to InnoDB, follow these steps:

By default, Mysql turns off the use of the InnoDB storage engine. Set InnoDB as the default engine as follows.

1. Check the MySQL storage engine status: mysql>show engines, the result is: InnoDB | YES, indicating that this MySQL database server supports the InnoDB engine.

2. Set InnoDB as the default engine: Add default-storage-engine=INNODB under [mysqld] in the my.ini configuration file

3. Restart the MySQL server

4. Log in to the MySQL database, mysql>show engines. If InnoDB | DEFAULT appears, it means that InnoDB has been successfully set as the default engine.

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • Summary of MySQL InnoDB architecture
  • A brief introduction to MySQL InnoDB ReplicaSet
  • Detailed explanation of memory management of MySQL InnoDB storage engine
  • MySQL Innodb key features insert buffer
  • Summary of MySQL InnoDB locks
  • How to distinguish MySQL's innodb_flush_log_at_trx_commit and sync_binlog
  • Detailed Example of MySQL InnoDB Locking Mechanism
  • In-depth explanation of InnoDB locks in MySQL technology
  • Briefly describe the MySQL InnoDB storage engine
  • MySQL InnoDB tablespace encryption example detailed explanation
  • MySQL InnoDB transaction lock source code analysis

<<:  Docker dynamically exposes ports to containers

>>:  Markup Languages ​​- What to learn after learning HTML?

Recommend

Tutorial on using Webpack in JavaScript

Table of contents 0. What is Webpack 1. Use of We...

Native JS realizes the special effect of spreading love by mouse sliding

This article shares with you a js special effect ...

Analysis of the principle of Vue nextTick

Table of contents Event Loop miscroTask (microtas...

MySQL common statements for viewing transactions and locks

Some common statements for viewing transactions a...

A brief introduction to MySQL InnoDB ReplicaSet

Table of contents 01 Introduction to InnoDB Repli...

HTML multi-header table code

1. Multi-header table code Copy code The code is a...

Mobile web screen adaptation (rem)

Preface I recently sorted out my previous notes o...

Three ways to forward linux ssh port

ssh is one of the two command line tools I use mo...