## 11.9 使用来自其他数据库引擎的数据类型 [](<>)[](<>)[](<>)[](<>)[](<>) 为了便于使用为其他供应商的 SQL 实现编写的代码,MySQL 映射数据类型,如下表所示。这些映射使得将表定义从其他数据库系统导入 MySQL 变得更加容易。 | 其他供应商类型 | MySQL 类型 | | ------- | -------- | | [`布尔值`](integer-types.html) | [`小音`](integer-types.html) | | [`布尔值`](integer-types.html) | [`小音`](integer-types.html) | | `字符变化(*`米`*)` | `VARCHAR(*`米`*)` | | [`固定的`](fixed-point-types.html) | [`十进制`](fixed-point-types.html) | | [`浮动4`](floating-point-types.html) | [`漂浮`](floating-point-types.html) | | [`浮动8`](floating-point-types.html) | [`双倍的`](floating-point-types.html) | | [`INT1`](integer-types.html) | [`小音`](integer-types.html) | | [`INT2`](integer-types.html) | [`小灵通`](integer-types.html) | | [`INT3`](integer-types.html) | [`中型`](integer-types.html) | | [`INT4`](integer-types.html) | [`INT`](integer-types.html) | | `INT8` | [`大整数`](integer-types.html) | | `长变量` | [`中块`](blob.html) | | `长 VARCHAR` | [`中文本`](blob.html) | | `长` | [`中文本`](blob.html) | | [`中间人`](integer-types.html) | [`中型`](integer-types.html) | | [`数字`](fixed-point-types.html) | [`十进制`](fixed-point-types.html) | 数据类型映射发生在表创建时,之后原始类型规范被丢弃。如果您使用其他供应商使用的类型创建表,然后发出`描述 *`tbl_name`*`语句,MySQL 使用等效的 MySQL 类型报告表结构。例如: ``` mysql> CREATE TABLE t (a BOOL, b FLOAT8, c LONG VARCHAR, d NUMERIC); Query OK, 0 rows affected (0.00 sec) mysql> DESCRIBE t; +-------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------+------+-----+---------+-------+ | a | tinyint(1) | YES | | NULL | | | b | double | YES | | NULL | | | c | mediumtext | YES | | NULL | | | d | decimal(10,0) | YES | | NULL | | +-------+---------------+------+-----+---------+-------+ 4 rows in set (0.01 sec) ```