MySql - Convert InnoDB to MyISAM Storage Engine of Database
MySql - Convert InnoDB to MyISAM Storage Engine of Database
To convert Database InnoDB Tables to MyISAM steps follow these steps
1. Take the backup of Mysql database
[root@Centos7 ]# mysqldump -f --opt mysqldb > /usr/mysqldb.sql
2. Convert the ENGINE from InnoDB to MYISAM by using below commans.
[root@Centos7 ]#mysql -u username -p -e "SELECT concat('ALTER TABLE ', TABLE_NAME,' ENGINE=MYISAM;') FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'db_name' AND ENGINE = 'InnoDB' AND TABLE_TYPE = 'BASE TABLE'" | tail -n+2 >> /root/MYISAM.sql
Note : Update username and db_name values with your own values.
3. mport that MYISAM.sql file into INNODB database
[root@Centos7 ]# mysql -u username -p mysqldb < /root/MYISAM.sql
4. Make it permanent, add to my.cnf
default-storage-engine= MyISAM
To convert Database InnoDB Tables to MyISAM steps follow these steps
1. Take the backup of Mysql database
[root@Centos7 ]# mysqldump -f --opt mysqldb > /usr/mysqldb.sql
2. Convert the ENGINE from InnoDB to MYISAM by using below commans.
[root@Centos7 ]#mysql -u username -p -e "SELECT concat('ALTER TABLE ', TABLE_NAME,' ENGINE=MYISAM;') FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'db_name' AND ENGINE = 'InnoDB' AND TABLE_TYPE = 'BASE TABLE'" | tail -n+2 >> /root/MYISAM.sql
Note : Update username and db_name values with your own values.
3. mport that MYISAM.sql file into INNODB database
[root@Centos7 ]# mysql -u username -p mysqldb < /root/MYISAM.sql
4. Make it permanent, add to my.cnf
default-storage-engine= MyISAM
Comments