mysql changes the engine of InnoDB MyISAM method

  • 2020-08-22 22:47:57
  • OfStack

This article describes the mysql change engine (InnoDB,MyISAM) method, Shared for your reference. Specific implementation methods are as follows:

The default database engine for mysql is MyISAM, which does not support transactions and foreign keys, but InnoDB, which does, can also be used.

View the supported database engine and default database engine for the current database

Database supported engine and default database engine code:

show engines;

Change to 1: Modify the configuration file my.ini

I saved ES21en-ES22en. ini as ES24en. ini and added default-ES28en-ES29en =InnoDB at the end of [mysqld], restarted the service and changed the default engine of the database to InnoDB

Change mode 2: Specify or complete table changes while building the table

Mysql code:
Specify when building the table

create table mytbl(   
    id int primary key,  
    name varchar(50)  

-- Modify after the table is built
alter table mytbl2 type = InnoDB;

-- View the modification results (mytest is the name of database where the table is)
show table status from mytest; 

-- or use
show create table table_name

I hope this article has been helpful to your MySQL database programming.

Related articles: