Mysql modifies the database storage engine (InnoDB)
The current example is to change the engine MyISAM to innodb.
View the supported database engines and default database engines of the current database
Database-supported engines and default database engine code
Show engines;
Change Method 1: modify the configuration file my. cnf
Open my. cnf, add "default-storage-engine = InnoDB" at the end of [mysqld], restart the Database Service, and change the default database engine to InnoDB.
Method 2: specify or modify the table when creating the table
Mysql code
-- Specify
Create table mytbl (
Id int primary key,
Name varchar (50)
) Type = InnoDB;
-- Modify the table after the table is created
Alter table mytbl2 type = InnoDB;
-- View the Modification result (mytest is the name of the database where the table is located)
Show table status from mytest;
Use commands to view the storage engine
Mysql> show variables like '% storage_engine %'; you need to check the engine used by a table (the storage engine used for the table is displayed after the parameter engine in the display result ):
Mysql> show create table name;