mysql> show engines;+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+| Engine | Support | Comment | Transactions | XA | Savepoints |+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL || MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO || InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES || PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO || MyISAM | YES | MyISAM storage engine | NO | NO | NO || MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO || BLACKHOLE | YES |/dev/null storage engine (anything you write to it disappears)| NO | NO | NO || CSV | YES | CSV storage engine | NO | NO | NO || ARCHIVE | YES | Archive storage engine | NO | NO | NO |+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set(0.37 sec)
Engine:表示存储引擎名称
Support:表示MySQL数据库管理系统是否支持该存储引擎,yes表示支持,no表示不支持
default:表示系统默认支持的存储引擎
Comment:表示对存储引擎的描述
Transactions:表示存储引擎是否支持事务,yes表示支持,no表示不支持
XA:表示存储引擎是否支持分布式事务,yes表示支持,no表示不支持
SavePoints:表示存储引擎是否支持部分事务回滚,yes表示支持,no表示不支持
2、默认存储引擎
查看默认存储引擎,执行以下命令
mysql> show variables like '%default_storage_engine%';+------------------------+--------+| Variable_name | Value |+------------------------+--------+| default_storage_engine | InnoDB |+------------------------+--------+
1 row in set(0.01 sec)
或
mysql> select @@default_storage_engine;+--------------------------+| @@default_storage_engine |+--------------------------+| InnoDB |+--------------------------+
1 row in set(0.05 sec)
修改默认存储引擎,执行以下命令
方式1:
[root@rqtanc ~]# vim /etc/my.cnf[mysqld]
default_storage_engine=MyISAM
[root@rqtanc ~]# systemctl restart mysqld
方式2:
mysql> show variables like '%default_storage_engine%';+------------------------+--------+| Variable_name | Value |+------------------------+--------+| default_storage_engine | MyISAM |+------------------------+--------+
1 row in set(1.36 sec)
mysql> set default_storage_engine=InnoDB;
Query OK, 0 rows affected (0.08 sec)
mysql> show variables like '%default_storage_engine%';+------------------------+--------+| Variable_name | Value |+------------------------+--------+| default_storage_engine | InnoDB |+------------------------+--------+
1 row in set(0.01 sec)