1、存储引擎
数据创建,查询,更新和删除操作都是通过数据引擎来进行的。不同的存储引擎存储限制不同,支持不同的索引机制等。
查询数据库支持的存储引擎
MySQL 5.7.2支持的存储引擎有:InnoDB,MRG_MYISAM,MEMORY,BLACKHOLE,MyISAM,CSV,ARCHIVE,PERFORMANCE_SCHEMA,FEDERATED。默认的存储引擎是InnoDB。
SHOW ENGINES;
mysql> 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)
InnoDB的特点:存储限制64TB,支持事务,支持树索引和数据缓存,外键。
2、数据类型
MySQL常见的数据类型有整型,字符串类型,时间类型,二进制类型。
整型
MySQL主要提供的整型有