mysql - 为什么 phpmyadmin 创建的数据表 int 默认为 int(11)
巴扎黑
巴扎黑 2017-04-17 11:53:10
0
2
651

int 最大长度不是 int(10) 吗,但是现在使用最新版本的phpmyadmin,创建数据表,如果选择类型为int,默认长度变成了 11,这个是一种趋势吗

巴扎黑
巴扎黑

reply all(2)
迷茫

The number after int has nothing to do with space usage and execution efficiency.
It is only used for display format, that is, when the field is set to ZEROFILL.
When used in conjunction with ZEROFILL, the default supplementary spaces are replaced with zeros.
Without ZEROFILL, this number is meaningless.

As for why it is int(11), not int(10).
Because for example, -2147483648 or something is 11, and if UNSIGNED is set, it will be 10.

黄舟

int occupies 4 bytes. If it is unsign, the storage range is 0 - 4294967295

int The following numbers will not affect storage and have no impact on the actual stored value. No matter what the following number is, it has no practical effect. A int only occupies four bytes.

only works when displayed on the client and must have the zerofill attribute.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template