February 2018
Intermediate to advanced
510 pages
16h 10m
English
When you create new table using the CREATE TABLE statement, you can specify which engine to be used for the table with the ENGINE table option. If you do not specify the ENGINE table option then the default storage engine will be used instead. InnoDB is the default engine for MySQL 8.0. You can also convert a table from one storage engine to another storage engine by using the ALTER TABLE statement, as shown in the following example:
CREATE TABLE table1 (i1 INT) ENGINE = INNODB;CREATE TABLE table3 (i3 INT) ENGINE = MEMORY;ALTER TABLE table3 ENGINE = InnoDB;
The default storage engine can be set for the current session by setting the default_storage_engine variable, as shown in the following example:
SET default_storage_engine=MEMORY; ...
Read now
Unlock full access