tinyint
The signed range is 128 to 127;
The unsigned range is 0 to 255, 2 of 8 square-1;
The storage size is 1 bytes.
smallint
The signed range is 32768 to 32767;
The unsigned range is 0 to 65535, 2 of 16 square-1;
The storage size is 2 bytes.
Mediumint
The signed range is 8388608 to 8388607;
The unsigned range is 0 to 16777215, 2 of 24 square-1;
The storage size is 3 bytes.
int
The signed range is 2147483648 to 2147483647;
The unsigned range is 0 to 4294967295, 2 of 32 square-1;
The storage size is 4 bytes.
bigint
The signed range is 9223372036854775808 to 9223372036854775807;
The unsigned range is 0 to 18446744073709551615, 2 of 64 square-1;
The storage size is 8 bytes.
MySQL in the Int (1) and tinyint (1) in the 1 is only the specified display length, does not indicate the storage length, only the field specified Zerofill useful
For example: Int (3), if the actual value is 2, if the column specifies Zerofill, the query result is 002 and the left is filled with zeros.
Note: Although the mobile phone number is generally a pure number, but the number of bits is longer, if the type of int, if the field is set unsigned will be stored as the maximum value of 4294967295,int, so if you want to use the shaping can be used bigint (1), but the general web-based data display mobile phone number this field, To avoid all kinds of problems, use varchar more.
Length problem with MySQL shaping