The type in the MySQL database is defined as "data type (m)":
Where the number m in different data types means that the meaning is different.
The integer system has limited the range of values, such as tinyint for one byte (8bit) and int for 4 bytes.
So the M after the integer is not the length of the data represented, but the minimum length (length is the number of characters) displayed when the data is displayed.
tinyint (1) Here 1 means that the minimum display width is 1 characters.
tinyint (2) Here 2 means that the minimum display width is 2 characters, but here the light setting m is meaningless, you also need to specify when the data is less than the length of M with what to fill, such as Zerofill (indicating that there is 0 padding).
Set tinyint (2) Zerofill you insert 1 o'clock he will show 01.
Set tinyint (4) Zerofill you insert 1 o'clock he will show 0001.
tinyint data types in MySQL