Home >Database >Mysql Tutorial >Does MySQL enable INNODB by default?
Yes, it is enabled by default starting with 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)
Now let us check my.ini where the default engine type InnoDB is visible -
Let us First create two tables. One of them will set the engine type, while the other will not.
First table -
mysql> create table DemoTable1(Id int NOT NULL AUTO_INCREMENT PRIMARY KEY); Query OK, 0 rows affected (0.80 sec)
Second table set up using 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 the above tables have engines regardless of whether you mentioned the engine type or not TypeInnoDB.
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)
Now let us 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 shown in the above table, you can Display the engine type as "InnoDB". Even though we did not mention the engine type in DemoTable1, the visible engine type is "InnoDB".
The above is the detailed content of Does MySQL enable INNODB by default?. For more information, please follow other related articles on the PHP Chinese website!