Mysql modifies the database storage engine (InnoDB)

Source: Internet
Author: User
Tags mysql code

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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.