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

Detailed explanation of React setState data update mechanism

Table of contents Why use setState Usage of setSt...

IE6/7 is going to be a mess: empty text node height issue

Preface: Use debugbar to view document code in iet...

Detailed explanation of three commonly used web effects in JavaScript

Table of contents 1 element offset series 1.1 Off...

Solutions to MySQL OOM (memory overflow)

OOM stands for "Out Of Memory", which m...

Detailed installation process and basic usage of MySQL under Windows

Table of contents 1. Download MySQL 2. Install My...

Example of making XML online editor using js

Table of contents Preface The need for online XML...

Three ways to draw a heart shape with CSS

Below, we introduce three ways to draw heart shap...

Parsing MySQL binlog

Table of contents 1. Introduction to binlog 2. Bi...

A "classic" pitfall of MySQL UPDATE statement

Table of contents 1. Problematic SQL statements S...

Implementation code for infinite scrolling with n container elements

Scenario How to correctly render lists up to 1000...

js to achieve simple drag effect

This article shares the specific code of js to ac...

Does Mysql ALTER TABLE lock the table when adding fields?

Table of contents Before MySQL 5.6 After MySQL 5....

JDBC-idea import mysql to connect java jar package (mac)

Preface 1. This article uses MySQL 8.0 version Co...

3 Tips You Must Know When Learning JavaScript

Table of contents 1. The magical extension operat...

Detailed explanation of the steps to build a Vue project with Vue-cli

First you need to install Vue-cli: npm install -g...