#database #mysql #reading-list

🔗 What does INT(11) mean in MySQL?

When looking at column definitions in MySQL, you'll see VARCHAR(255) and you know it means that the column can store up to 255 characters, and no more.

There is a similar-seeming property for numeric types, like INT(11). The database tools I frequently use even show this number in the same way as the VARCHAR length.

I was working in a legacy database recently and saw some very bizarre numbers like INT(4) or INT(200) and it got me curious as to what it actually means, since it doesn't impact the acceptable range of numbers you can store.

The MySQL docs explain that this attribute is for setting display width. It's purely for display purposes in database tools that support it. And it's going away. In MySQL 8.0.17, this attribute was deprecated.

continue reading on masteringlaravel.io

⚠️ This post links to an external website. ⚠️