How to query the mysql engine: 1. Use the "show engines;" command to query which engines mysql has provided; 2. Use the "show variables like '%storage_engine%';" command to query mysql The current default engine.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
Under normal circumstances, mysql will provide multiple storage engines by default. You can view it through the following:
See what storage engines your mysql currently provides:
mysql> show engines;
Check the current default storage engine of your mysql:
mysql> show variables like '%storage_engine%';
You need to check what engine is used for a certain table (the one after the parameter engine in the displayed results indicates the current storage engine used by the table):
mysql> show create table 表名;
Extended knowledge:
Mysql's storage engine includes:
MyISAM, InnoDB, BDB, MEMORY, MERGE, EXAMPLE, NDBCluster, ARCHIVE, CSV, BLACKHOLE, FEDERATED, etc., among which InnoDB and BDB provide transaction-safe tables, and other storage engines are non-transaction-safe tables.
The 2 most commonly used storage engines:
1. Myisam is the default storage engine of Mysql. When create creates a new table and the storage engine of the new table is not specified, Myisam is used by default. . Each MyISAM is stored as three files on disk. The file names are the same as the table names, and the extensions are .frm (storing table definition), .MYD (MYData, storing data), and .MYI (MYIndex, storing index). Data files and index files can be placed in different directories to evenly distribute IO and obtain faster speeds.
2. The InnoDB storage engine provides transaction security with commit, rollback and crash recovery capabilities. However, compared to Myisam's storage engine, InnoDB's write processing efficiency is less efficient and takes up more disk space to retain data and indexes.
[Related recommendations:mysql video tutorial]
The above is the detailed content of How to query the mysql engine. For more information, please follow other related articles on the PHP Chinese website!