扶墙老师说

一个架构士的思考与沉淀 扶墙老师,辨证施“知”


类似Int(10)这样的定义, 10表示的是display length,不是byte length。
Type Storage Minimum Value (Signed/Unsigned) Maximum Value (Signed/Unsigned)
TINYINT 1 -128/0 127/255
SMALLINT 2 -32768/0 32767/65535
MEDIUMINT 3 -8388608/0 8388607/16777215
INT 4 -2147483648/0 2147483647/4294967295
BIGINT 8 -9223372036854775808/0 9223372036854775807/18446744073709551615