How to change the default engine of Mysql to Innodb: mysqlinnodb

Source: Internet
Author: User

How to change the default engine of Mysql to Innodb: mysqlinnodb

Preface

InnoDB and MyISAM are the two most common table types used by many people when using MySQL. The two table types have their own advantages and disadvantages, depending on the specific application.

The basic difference is:The MyISAM type does not support advanced processing such as transaction processing, whereas the InnoDB type does. MyISAM tables emphasize performance, and the execution speed is faster than that of InnoDB, but transactions are not supported. InnoDB provides advanced database functions such as transaction support and external keys.

The reason why I want to change the default engine 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 disables the InnoDB Storage engine and sets InnoDB as the default engine as follows.

1. view the Mysql storage engine:Mysql> show engines InnoDB | YESThe Mysql database server supports the InnoDB engine.

2. Set InnoDB as the default engine: In the configuration fileMy. iniUnder [mysqld] InDefault-storage-engine = INNODB

3. Restart the Mysql server

4. log on to the Mysql database,Mysql> show enginesIfInnoDB | DEFAULTIndicates that InnoDB is successfully set as the default engine.

Summary

The above is all about changing the default Mysql engine to Innodb. I hope the content in this article will help you in your study or work. If you have any questions, please leave a message.

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.