MySQL出现警告:Integer display width is deprecated and will be removed in a future release

Integer display width is deprecated and will be removed in a future release: Integer display width is deprecated and will be removed in a future release

For integer data types such as INT[M], M indicates the display width, and for floating-point and fixed-point data types, M is the total number of bits that can be stored. As of MySQL 8.0.17, the display width property is deprecated for integer data types, i.e. not displaying the width with M, and support for it will be removed in a future MySQL release.

For example, INT(4) specifies an INT display width of four digits. Applications can use this optional display width to display integer values ​​that are less wide than the width specified for the column by left padding with spaces. If the number of digits inserted is larger than the displayed value of width M, the value can still be inserted and the original number will be displayed. For example, year INT[4], the value of year is 12345, then 12345 is still displayed.

Related Posts