
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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)
- Related Articles
- MySQL - changing table engine from innoDB to MyISAM?
- How to display all tables in MySQL with InnoDB storage engine?
- MyISAM versus InnoDB in MySQL?
- How do I know if a MySQL table is using myISAM or InnoDB Engine?
- Converting table from MyISAM to INNODB in MySQL?
- When to use MyISAM and InnoDB?
- While creating a MySQL table, how can I specify the storage engine of my choice rather than using the default storage engine InnoDB?
- How to create a MySQL table with MyISAM engine table?
- How to update MySQL table storage engine
- How to create a MySQL table with InnoDB engine table?
- Can I use InnoDB and MyISAM tables in a single database in MySQL?
- How to display all the tables in MySQL with a storage engine?
- How to display the storage engine while implementing JDBC - MySQL CONNECTION query?
- How can I change the storage engine of a MySQL table?
- How to know which storage engine is used in MongoDB?\n

Advertisements