MySQL database MyISAM storage engine to Innodb _ MySQL
Source: Internet
Author: User
The MySQL database MyISAM storage engine is converted to Innodb. when the mysql database storage engine is MyISAM, data tables may be locked in the case of high traffic volumes, this will cause users to return 502 when they connect to the website. in this case, the MySQL database MyISAM storage engine needs to be converted to Innodb.
The procedure is as follows:
1,
Export the table structure of the CentOS database
Mysqldump-d-uxxx-p centos> centos_table. SQL
The-d parameter indicates that no data is exported, and only the table structure is exported.
2,
Replace MyISAM in centos_table. SQL with INNODB
Sed-I's/MyISAM/INNODB/g' centos_table. SQL
3,
Create a database centos_new and import the table structure
Mysql> create database centos_new;
Mysql-uroot-p centos_new <centos_table. SQL
You can use show table status to check whether the engine is INNODB.
4,
Export centos data
Mysqldump-t-uroot-p centos> centos_data. SQL
The-t parameter indicates that only data is imported, and the table structure is not imported.
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