Three methods to modify the Database Engine

Source: Internet
Author: User

Three ways to modify the Database Engine 1. directly alter tableSql code alter table youTable ENGINE = InnoDB; this method is the easiest, but it takes a long time for Big Data Tables, because MySQL needs to perform row-by-row replication from the old TABLE to the new TABLE. MySQL locks the entire table regardless of the engine used to operate the alter table operation. Www.2cto.com 2. Use dump and source to first dump the desired TABLE, then modify the dump file, remove drop table, modify the create table code, and execute source. In this way, the engine cannot be modified online, and the database must be deprecated or synchronized after being modified online. 3. use the create and SELECTSql code create table myTableCopy LIKE myTable; alter table myTableCopy ENGINE = InnoDB; insert into myTableCopy SELECT * FROM myTable WHERE id BETWEEN x AND y; in this way, when the table data volume is large, you can import data in batches according to the range without locking myTable.

Related Article

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.