1. Export the CentOS database table structure
- mysqldump-d-uxxx-p CentOS > Centos_table.sql
Where the-d parameter indicates that no data is exported, only the table structure is exported
2, replace the centos_table.sql in the MyISAM for InnoDB
- Sed-i ' s/myisam/innodb/g ' Centos_table.sql
3. Create a new database centos_new and import the table structure
- MySQL > CREATE database centos_new;
- Mysql-uroot-p Centos_new < Centos_table.sql
You can check whether the table engine is innodb by Show table status.
4. Exporting CentOS Data
- Mysqldump-t-uroot-p CentOS > Centos_data.sql
Where-t parameter indicates only data, non-guided table structure
5. Import data to Centos_new
- Mysql-uroot-p Centos_new < Centos_data.sql
Finally, if you want to change the Centos_new database name to CentOS, you can refer to http://www.cnblogs.com/zhonglizhengkai/p/4496692.html
MySQL database MyISAM storage engine to InnoDB