11.1.2 Integer Types (Exact Value)整数类型(精确值) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT

MySQL supports the SQL standard integer types INTEGER (or INT) and SMALLINT. MySQL支持SQL标准整数类型INTEGER(或INT)和SMALLINTAs an extension to the standard, MySQL also supports the integer types TINYINT, MEDIUMINT, and BIGINT. 作为标准的扩展,MySQL还支持整数类型TINYINTMEDIUMINTBIGINTThe following table shows the required storage and range for each integer type.下表显示了每个整数类型所需的存储和范围。

Table 11.1 Required Storage and Range for Integer Types Supported by MySQLMySQL支持的整数类型所需的存储和范围

Type类型Storage (Bytes)存储(字节)Minimum Value Signed带符号的最小值Minimum Value Unsigned无符号的最小值Maximum Value Signed带符号的最大值Maximum Value Unsigned无符号的最大值
TINYINT1-1280127255
SMALLINT2-3276803276765535
MEDIUMINT3-83886080838860716777215
INT4-2147483648021474836474294967295
BIGINT8-2630263-1264-1