Home > Database > Mysql Tutorial > body text

Does MySQL enable INNODB by default?

WBOY
Release: 2023-09-01 21:09:05
forward
1269 people have browsed it

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)
Copy after login

Now let us check my.ini where the default engine type InnoDB is visible -

Does MySQL enable INNODB by default?

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)
Copy after login

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)
Copy after login

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)
Copy after login

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template