MySQL learning notes: data engine

MySQL learning notes: data engine

View the engines supported by the current database

show engines
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)

or

show engines \G
mysql> show engines \G
*************************** 1. row ***************************
   Engine: InnoDB
   Support: DEFAULT
   Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
     XA: YES
 Savepoints: YES
*************************** 2. row ***************************
   Engine: MRG_MYISAM
   Support: YES
   Comment: Collection of identical MyISAM tables
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 3. row ***************************
   Engine: MEMORY
   Support: YES
   Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 4. row ***************************
   Engine: BLACKHOLE
   Support: YES
   Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 5. row ***************************
   Engine: MyISAM
   Support: YES
   Comment: MyISAM storage engine
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 6. row ***************************
   Engine: CSV
   Support: YES
   Comment: CSV storage engine
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 7. row ***************************
   Engine: ARCHIVE
   Support: YES
   Comment: Archive storage engine
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 8. row ***************************
   Engine: PERFORMANCE_SCHEMA
   Support: YES
   Comment: Performance Schema
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 9. row ***************************
   Engine: FEDERATED
   Support: NO
   Comment: Federated MySQL storage engine
Transactions: NULL
     XA: NULL
 Savepoints: NULL
9 rows in set (0.00 sec)

Engine The name of the engine
Support Payment Yes means support, No means no support
Comment Comment or note Default indicates the default supported engine
Transactions: whether to support transactions, YES means support, NO means not support
XA Whether all supported distributions comply with the XA specification. YES indicates support, and NO indicates non-support
Savepoints Whether to support savepoints in transaction processing, YES means support, NO means no support

or

show variables like 'have%'

mysql> show variables like 'have%';
+------------------------+----------+
| Variable_name | Value |
+------------------------+----------+
| have_compress | YES |
| have_crypt | NO |
| have_dynamic_loading | YES |
| have_geometry | YES |
| have_openssl | DISABLED |
| have_profiling | YES |
| have_query_cache | YES |
| have_rtree_keys | YES |
| have_ssl | DISABLED |
| have_statement_timeout | YES |
| have_symlink | YES |
+------------------------+----------+
11 rows in set, 1 warning (0.00 sec)

Variable_name Engine name
value whether it is supported YES means it is supported, NO means it is not supported, and DISABLED means it is supported but not enabled

View Default Engine

show variables like '%storage_engine%'

mysql> show variables like '%storage_engine%';
+----------------------------------+--------+
| Variable_name | Value |
+----------------------------------+--------+
| default_storage_engine | InnoDB |
| default_tmp_storage_engine | InnoDB |
| disabled_storage_engines | |
| internal_tmp_disk_storage_engine | InnoDB |
+----------------------------------+--------+
4 rows in set, 1 warning (0.00 sec)

InnoDB is the default engine

Modify the default engine

my.ini file

[mysqld]
# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory
# shared-memory-base-name=MYSQL
# The Pipe the MySQL Server will use
# socket=MYSQL
# The TCP/IP Port the MySQL Server will listen on The default port number is port=3306
# Path to installation directory. All paths are usually resolved relative to this. The default installation directory of the server # basedir="C:/Program Files/MySQL/MySQL Server 5.7/"
# Path to the database root directory of the database data file datadir=C:/ProgramData/MySQL/MySQL Server 5.7\Data
# The default character set that will be used when a new schema or table is
# created and no character set is defined Modify the server default character character-set-server=utf8
# The default storage engine that will be used when creating new tables when
# Modify the default engine here default-storage-engine=INNODB

Restart the Mysql service after modification

You may also be interested in:
  • Detailed explanation of transaction isolation levels in MySql study notes
  • MySQL learning notes help document
  • Basic knowledge of MySQL learning notes
  • MySQL learning notes: how to add, delete and modify data
  • MySQL learning notes: how to create, delete, and modify tables
  • Summary of MySQL learning notes
  • A summary of MySQL study notes of 1,000 lines
  • MySQL Learning Notes 5: Modify Table (alter table)
  • MySQL Learning Notes 4: Integrity Constraint Restriction Fields
  • MySQL Learning Notes 1: Installation and Login (Multiple Methods)
  • Complete MySQL Learning Notes

<<:  Vue data responsiveness summary

>>:  Vue v-model related knowledge summary

Recommend

How to write a picture as a background and a link (background picture plus link)

The picture is used as the background and the lin...

TCP performance tuning implementation principle and process analysis

Three-way handshake phase Number of retries for c...

How to recover deleted MySQL 8.0.17 root account and password under Windows

I finished learning SQL by myself not long ago, a...

Detailed explanation of how to enable slow query log in MySQL database

The database enables slow query logs Modify the c...

Learn the common methods and techniques in JS arrays and become a master

Table of contents splice() Method join() Method r...

CSS tips for implementing Chrome tab bar

This time let’s look at a navigation bar layout w...

Summary of special processing statements of MySQL SQL statements (must read)

1. Update the entire table. If the value of a col...

How to implement online hot migration of KVM virtual machines (picture and text)

1. KVM virtual machine migration method and issue...

Docker starts Redis and sets the password

Redis uses the apline (Alps) image of Redis versi...

Detailed explanation of routes configuration of Vue-Router

Table of contents introduce Object attributes in ...

A simple example of how to implement fuzzy query in Vue

Preface The so-called fuzzy query is to provide q...

How to configure the same domain name for the front and back ends of nginx

This article mainly introduces the method of conf...