MySQL Error Code: 1264. Out of range value for column ‘columnname’ at row 1

databasemysqlmysql-error-1264mysql-workbenchworkbench

I'm using MySQL to store a 20-digit ID number. When I query the database with the following query, I get the following error.

Query:

UPDATE tablename SET columnname = 59641217344615859740;

Error:

Error Code: 1264. Out of range value for column 'columnname' at row 1

Table Info:

Engine: InnoDB
Row Format: Dynamic
Table Collation: utf8mb4_general_ci

Column Info:

Type: BIGINT(255)
Nullable: Yes
Privileges: Select, Insert, Update, References

What am I doing wrong? Is there something wrong with my query? Maybe with the table or column settings? Most others who have this error just aren't using a column type such as BIGINT but I am. An answer is much appreciated. Thanks!

Best Solution

You've reached the MAXIMUM VALUE of the data type you used.

MySQL supports the SQL standard integer types INTEGER (or INT) and SMALLINT. 
As an extension to the standard, MySQL also supports the integer types 
TINYINT, MEDIUMINT, and BIGINT. The following table shows the required storage 
and range for each integer type.

Type Storage Minimum Value Maximum Value

        (Bytes) (Signed/Unsigned)   (Signed/Unsigned)
TINYINT   1           -128           127
                       0             255
SMALLINT    2     -32768            32767
                     0               65535
MEDIUMINT   3     -8388608           8388607
                      0              16777215
INT         4   -2147483648          2147483647
                      0              4294967295
BIGINT       8  -9223372036854775808    9223372036854775807
                        0             18446744073709551615