BIGINT no more than 255 characters?

I need my integer column so that it can go to 2000, so I made it INT(2000) , but it keeps saying:

Display Width Out of Range for Column (max = 255)

I tried using MEDIUMINT(2000) and BIGINT(2000) , but both of them give the same message.

+5
source share
2 answers

The number used in the SQL type is the width of the type, not the maximum value. When used in a numeric type, it displays the maximum number of digits in the 10th range used to represent the value in this column: for example, INT(5) can represent any value up to 99999.

A number with a maximum value of 2000 can be stored in any numeric column with a width of 4 or greater. But don't worry about the width; just use regular INT and let the database use any default size for this type. (It will be more than 4, but it is normal.)

+5
source

BIGINT (255) This means a large integer with 255 digits.

And well, this is a very large number, especially when the UNSIGNED flag is used.

BIGINT is mainly used for identifier.

Therefore, I do not think you need a number greater than a 255-digit number.

Or, if you need it, save it in a line.

0
source

Source: https://habr.com/ru/post/1237066/


All Articles