Home >Database >Mysql Tutorial >How to specify storage engine in mysql?

How to specify storage engine in mysql?

青灯夜游
青灯夜游Original
2020-10-27 10:13:507174browse

How to specify the engine in mysql: 1. When creating a table, you can specify the storage engine through ENGINE. Just add "engine=storage engine;" at the end of the create statement; 2. When modifying the table, you can Use "alter table table name engine=storage engine;" to specify the storage engine.

How to specify storage engine in mysql?

(Recommended tutorial: mysql video tutorial)

Storage engine, that is, table type (table_type)

Users can choose how to store data, indexes, whether to use transactions, etc. according to the needs of the application. Choosing an appropriate storage engine can often effectively improve database performance and data access efficiency. In addition, multiple tables in a database can use a combination of different engines to meet various performance and actual needs.

MySQL supports many storage engines, including MyISAM, InnoDB, BDB, MEMORY, MERGE, EXAMPLE, NDB Cluster, ARCHIVE, etc., among which InnoDB and BDB support transaction security. It also supports some third-party storage engines, such as TokuDB (high write performance and high compression storage engine) and Infobright (column storage engine).

mysql specifies the storage engine

The first way to change the storage engine is to change the MySQL configuration file, as shown in the figure below, find the my.ini file

How to specify storage engine in mysql?

Open a line and find the line shown in the figure below. Here, modify the storage engine to what is required, as shown in the figure below

How to specify storage engine in mysql?

Next we can also modify it through SQL statements, as shown in the figure below.

In the process of creating the table, the storage engine can be specified through ENGINE, and engine is added at the end of the create statement. =MyISAM

How to specify storage engine in mysql?

Next, use the Show statement to view the creation statement of the table, and you will find that the storage engine has been modified to MyISAM, as shown in the figure below

How to specify storage engine in mysql?

In addition, we can also modify the storage engine of an existing table through the alter table statement, as shown in the figure below

How to specify storage engine in mysql?

Modified In the future, you should check the storage engine for verification through the Show statement, as shown in the figure below

How to specify storage engine in mysql?

Extended information

View the storage engine used by the current table

mysql> show create table emp;

How to specify storage engine in mysql?

or

mysql> show table status like 'emp' \G;

How to specify storage engine in mysql?

View the storage engines supported by the current database

mysql> show engines \G;

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of How to specify storage engine in mysql?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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