What is the MAX number if I store int(255) in MySQL?

Something is probably just converting that to int(11) for you. Since you can’t have 255 visible digits in an int, the maximum value will be 2147483647.

If you need more than that you can set it to be unsigned, since I’m assuming you have no negative ids and then you can have up to 4294967295.

If you are ever going to have more than 4 billion records (very unlikely if you’re at 1 million right now), then you could use a bigint instead, which allows you to store numbers up to 18446744073709551615 at a cost of more storage space of course.

Leave a Comment