Is INNODB enabled by default in MySQL?


Yes, it is enabled by default from MySQL version 4.0. Here, we are using MySQL version 8.0.1 −

mysql> select version();
+-----------+
| version() |

+-----------+
| 8.0.12    |
+-----------+
1 row in set (0.00 sec)

Let us now check the my.ini wherein the default engine type InnoDB is visible −

Let us first create two table. One of them would be set with engine type, whereas the other one won’t be set with the engine type.

The first table −

mysql> create table DemoTable1(Id int NOT NULL AUTO_INCREMENT PRIMARY KEY);
Query OK, 0 rows affected (0.80 sec)

The second table set with ENGINE InnoDB −

mysql> create table DemoTable2(
   Id int NOT NULL AUTO_INCREMENT PRIMARY KEY
) ENGINE=InnoDB;
Query OK, 0 rows affected (0.76 sec)

Both of the above tables have engine type InnoDB whether you have mentioned the engine type or not.

Let us check the engine type of the first table −

mysql> select engine from information_schema.TABLES where TABLE_SCHEMA = 'web' and table_name='DemoTable1';
+--------+
| ENGINE |
+--------+
| InnoDB |
+--------+
1 row in set (0.56 sec)

Let us now check the engine type of the second table −

mysql> select engine from information_schema.TABLES where TABLE_SCHEMA = 'web' and table_name='DemoTable2';
+--------+
| ENGINE |
+--------+
| InnoDB |
+--------+
1 row in set (0.00 sec)

As you can both of the above table display the engine type as “InnoDB”. The engine type visible is “InnoDB” even when we haven’t mentioned the engine type in DemoTable1.

Updated on: 03-Sep-2019

108 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements