- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert MyISAM to InnoDB storage engine in MySQL?
To convert the MyISAM Engine to InnoDB, we can use the ALTER command. Let us now create a table with the help of engine MyISAM.
mysql> create table MyISAMToInnoDBDemo -> ( -> id int, -> Name varchar(100) -> )ENGINE=MyISAM; Query OK, 0 rows affected (0.19 sec)
To check if the table is created with engine MyISAM or not.
mysql> SELECT TABLE_NAME,ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'business' and ENGINE = 'MyISAM';
The following is the output that displays the table created with MyISAM engine.
+-------------------------+--------+ | TABLE_NAME | ENGINE | +-------------------------+--------+ | studentrecordwithmyisam | MyISAM | +-------------------------+--------+ 1 row in set (0.00 sec)
We can convert MyISAM to InnoDB with the help of ALTER command.
mysql> alter table MyISAMToInnoDBDemo engine=InnoDB; Query OK, 0 rows affected (1.65 sec) Records: 0 Duplicates: 0 Warnings: 0
To check the conversion.
mysql> SELECT TABLE_NAME,ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'test' and ENGINE = 'InnoDB';
Here is the output.
+--------------------+--------+ | TABLE_NAME | ENGINE | +--------------------+--------+ | myisamtoinnodbdemo | InnoDB | +--------------------+--------+ 1 row in set (0.00 sec)
Advertisements