Alex Rivera | Logout

Mysql int(11) number out of range

Asked 2011-08-03T04:25:18.310
33

I have a column which is set to int(20) when I try and insert a number like 622108120237, it says it's out of range. Why?

Edit
Report

1 Answer

53

An int, with MySQL, is stored on 4 bytes, and, as such, can only contain values between -2147483648 and 2147483647.

622108120237 is greater than 2147483647 ; so it doesn't fit into an int -- looks like you are going to have to use a bigint.

See the Datatypes - Numeric types section of
the MySQL manual, about that.

answered 2011-08-03T04:28:17.453

Your Answer