当前位置:Gxlcms > 数据库问题 > mysql存储引擎

mysql存储引擎

时间:2021-07-01 10:21:17 帮助过:26人阅读

查看当前支持的引擎

  1. mariadb> show engines;
  2. +--------------------+---------+----------------------------------------------------------------------------+--------------+-----+------------+
  3. | Engine | Support | Comment | Transactions | XA | Savepoints |
  4. +--------------------+---------+----------------------------------------------------------------------------+--------------+-----+------------+
  5. | CSV | YES | CSV storage engine | NO | NO | NO |
  6. | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
  7. | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
  8. | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
  9. | MyISAM | YES | MyISAM storage engine | NO | NO | NO |
  10. | InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
  11. | ARCHIVE | YES | Archive storage engine | NO | NO | NO |
  12. | FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
  13. | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
  14. | Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
  15. +--------------------+---------+----------------------------------------------------------------------------+--------------+-----+------------+
  16. 10 rows in set
  17. #最常用的是innodb和MyISAM
  18. #可见,默认引擎是innodb

  

查看表引擎

引擎是表级别的,在创建表的时候,可以设定engine=innodb或者其他引擎。如果不设定,就按服务的默认引擎来。

  1. mariadb> show create table history;
  2. +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  3. | Table | Create Table |
  4. +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  5. | history | CREATE TABLE `history` (
  6. `itemid` bigint(20) unsigned NOT NULL,
  7. `clock` int(11) NOT NULL DEFAULT ‘0‘,
  8. `value` double(16,4) NOT NULL DEFAULT ‘0.0000‘,
  9. `ns` int(11) NOT NULL DEFAULT ‘0‘,
  10. KEY `history_1` (`itemid`,`clock`)
  11. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
  12. +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  13. 1 row in set

  

 

mysql存储引擎

标签:table   port   engine   col   ash   innodb   comment   引擎   points   

人气教程排行