当前位置:网站首页>Mysql database common sense storage engine

Mysql database common sense storage engine

2022-04-23 20:45:00 Jan York

My blog

Storage engine classification

show engines;

This command can view the data engine of the database , You can see InnoDB Is the default engine .

The command runs in addition to the terminal , You can also run in the query database visualizer .

and ,( I am a 5.7 edition ) We can see that in the database , There are nine storage engines .

Namely **InnoDBMRG_MYISAMMEMORYBLACKHOLEMyISAMCSVARCHIVEPERFORMANCE_SCHEMAFEDERATED**.

Set the default engine

SHOW VARIABLES  LIKE 'default_storage_engine%'

This statement can query the current default database engine .

default_storage_engine% Indicates the default database storage engine .

If we want to modify the default storage engine , We can modify my.ini/my.cnf File implementation ( Don't suggest !).

add to  default-storage-engine = Database engine name (INNODB/MYISAM).

sudo service mysql restart

Restart with command mysql.

Use the following statement to modify the database temporary The default storage engine for :

SET default_storage_engine=<  Storage engine name  >

But when you restart the client again , The default storage engine is still InnoDB.

Specify the engine when creating the table

CREATE TABLE  Table name  (
	--  Field omission 
) ENGINE = MyISAM;

**ENGINE = Engine type ** Followed by the statement under construction , You can specify the engine .

版权声明
本文为[Jan York]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232039375806.html