Home >Database >Mysql Tutorial >How to specify storage engine in mysql?
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.
(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
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
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
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
In addition, we can also modify the storage engine of an existing table through the alter table statement, as shown in the figure below
Modified In the future, you should check the storage engine for verification through the Show statement, as shown in the figure below
Extended information
View the storage engine used by the current table
mysql> show create table emp;
or
mysql> show table status like 'emp' \G;
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!