I’m getting this warning when importing mysql dumps in phpMyAdmin:
Warning: #1681 Integer display width is deprecated and will be removed in a future release.
I found this on https://dev.mysql.com/worklog/task/?id=13127
Deprecate the ZEROFILL attribute for numeric data types and the display width attribute for integer types.
but i don’t really understand what it means. Can someone explain what is the problem generating this warning, and how to resolve it.
3
Answers
Check this Numeric Type Attributes for the much complete story:
So it shall be safe to ignore these kind of warning up to current version of MySQL (8.0.17 as of writing).
If you’d like to avoid these warnings and play safe, update all your affected tables having column type definitions of something like
INT(##)
toINT
(i.e. without explicitly specifying the display width).It means you should not specify the width of an integer value. Just write it as only
int
, notint(5)
.The warning applies to all
INT
types:INT
,SMALLINT
,TINYINT
,MEDIUMINT
,BIGINT
. It means in future MySQL releases there will be no need to specify display length.In my case it was
TINYINT(1)
that triggered the warning.To prevent the warning, do:
is_duplicate TINYINT
instead ofis_duplicate TINYINT(1)