If I leave length/values field of integer type blank in MySQL how much length of data can it store?

Rolen Koh picture Rolen Koh · Mar 15, 2013 · Viewed 19.5k times · Source

When creating a table we normally make id field of integer type. But if I don't specify any value in length field how much length data will it store?

Answer

Vince K picture Vince K · Jun 28, 2013

I found an explanation elsewhere that says the value/length you specify when creating a numeric column only comes into play if you are using zerofill queries. Example here.

If you stored a value of 5
INT(4) would display 0005
INT(11) would display 00000000005

There's a note in mysql docs that tells of possible trouble when making it too small, so personally I just leave it blank when making a new numeric column.