This article describes the MySQL Change engine (Innodb,myisam) method, share for everyone to reference. The implementation methods are as follows:
The MySQL default database engine is MyISAM, does not support transactions and foreign keys, and can also use InnoDB that support transactions and foreign keys.
View the supported database engine for the current database and the default database engine
Database-supported engine and default database engine code:
Copy Code code as follows:
Change Mode 1: Modify configuration file My.ini
I save the My-small.ini as a my.ini, at the end of [mysqld] add as upper Default-storage-engine=innodb, restart the service, and the database default engine is modified to InnoDB
Change Mode 2: specify or complete a table modification when building a table
MySQL Code:
--Specify when building the table
Copy Code code as follows:
CREATE TABLE Mytbl (
ID int PRIMARY KEY,
Name varchar (50)
) Type=myisam;
--Modified after the table is completed
Copy Code code as follows:
ALTER TABLE MYTBL2 type = InnoDB;
--View the modified result (MyTest is the database name of the table)
Copy Code code as follows:
Show table status from MyTest;
-or use
Copy Code code as follows:
Show CREATE TABLE table_name
I hope this article is helpful to the design of MySQL database.