問題描述
mysql中int(11)
的列的大小是多少字節?
What is the size of column of int(11)
in mysql in bytes?
以及可以存儲在此列中的最大值?
And Maximum value that can be stored in this columns?
推薦答案
無論指定什么長度,INT
總是 4 個字節.
An INT
will always be 4 bytes no matter what length is specified.
TINYINT
= 1 字節(8 位)SMALLINT
= 2 字節(16 位)MEDIUMINT
= 3 個字節(24 位)INT
= 4 字節(32 位)BIGINT
= 8 字節(64 位).
TINYINT
= 1 byte (8 bit)SMALLINT
= 2 bytes (16 bit)MEDIUMINT
= 3 bytes (24 bit)INT
= 4 bytes (32 bit)BIGINT
= 8 bytes (64 bit).
長度只是指定用mysql命令行客戶端選擇數據時要填充多少個字符.12345 存儲為 int(3)
仍將顯示為 12345,但如果將其存儲為 int(10)
仍將顯示為 12345,但您可以選擇填充前五位數字.例如,如果您添加了 ZEROFILL
,它將顯示為 0000012345.
The length just specifies how many characters to pad when selecting data with the mysql command line client. 12345 stored as int(3)
will still show as 12345, but if it was stored as int(10)
it would still display as 12345, but you would have the option to pad the first five digits. For example, if you added ZEROFILL
it would display as 0000012345.
... 最大值為 2147483647(有符號)或 4294967295(無符號)
... and the maximum value will be 2147483647 (Signed) or 4294967295 (Unsigned)
這篇關于mysql 中 int(11) 列的大小(以字節為單位)是多少?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!