I went into phpMyAdmin and changed the value for an integer(15)field to a 10-digit number, so everything should work fine. I entered the value '4085628851' and I am receiving the following error:
我进入phpMyAdmin并将一个整数(15)字段的值更改为10位数,所以一切都应该没问题。我输入了“4085628851”,我收到了以下错误:
Warning: #1264 Out of range value adjusted for column 'phone' at row 1
警告:#1264在第1行的列“电话”中调整了范围值。
It then changes the value to '2147483647'.
然后将值更改为“2147483647”。
After some googling, I found this article that explains how to fix the problem. http://webomania.wordpress.com/2006/10/01/out-of-range-value-adjusted-for-column-error/, but I don't know how to login to the Mysql shell.
在谷歌搜索之后,我发现了这篇文章,解释了如何解决这个问题。http://webomania.wordpress.com/2006/10/01/01/outrangevalue -for-column-error/,但我不知道如何登录到Mysql shell。
How do I login to the Mysql shell? How do I fix this error?
如何登录到Mysql shell?如何修正这个错误?
4 个解决方案
#1
22
The value you were trying to set is too large for a signed INT
field. The display width (15)
does not affect the range of values that can be stored, only how the value is displayed.
您试图设置的值对于已签名的INT字段来说太大了。显示宽度(15)不会影响可存储的值的范围,只影响值的显示方式。
编号:MySQL文档。
On phone numbers - see Is it better to store telephone numbers in some canonical format or "as entered"?
在电话号码上——用某种规范的格式存储电话号码或“输入”会更好吗?
#2
9
I just changed the field type to BIGINT, and that fixed the problem. I guess i cant enter a value above 2147483647 for an INT, so I assume everyone who uses a field to enter a 10-digit phone number uses a BIGINT?
我只是将字段类型改为BIGINT,这就解决了问题。我猜我不能输入一个值超过2147483647的整数,所以我假设每个使用一个字段输入一个10位数的电话号码的人使用一个BIGINT?
#3
8
Best option for storing an integer of value bigger than 2147483647 would be to make the field type as BIGINT.
存储大于2147483647的整数的最佳选项将是使字段类型为BIGINT。
If it is for storing phone number, then way better is to store the value as a text field.
如果是存储电话号码,那么更好的方法是将值存储为文本字段。
#4
0
you can try not giving the value that starts with'0'. If you want to begin the values with zero, then use varchar datatype
你可以试着不给出以“0”开头的值。如果希望以0开始值,则使用varchar数据类型。
#1
22
The value you were trying to set is too large for a signed INT
field. The display width (15)
does not affect the range of values that can be stored, only how the value is displayed.
您试图设置的值对于已签名的INT字段来说太大了。显示宽度(15)不会影响可存储的值的范围,只影响值的显示方式。
编号:MySQL文档。
On phone numbers - see Is it better to store telephone numbers in some canonical format or "as entered"?
在电话号码上——用某种规范的格式存储电话号码或“输入”会更好吗?
#2
9
I just changed the field type to BIGINT, and that fixed the problem. I guess i cant enter a value above 2147483647 for an INT, so I assume everyone who uses a field to enter a 10-digit phone number uses a BIGINT?
我只是将字段类型改为BIGINT,这就解决了问题。我猜我不能输入一个值超过2147483647的整数,所以我假设每个使用一个字段输入一个10位数的电话号码的人使用一个BIGINT?
#3
8
Best option for storing an integer of value bigger than 2147483647 would be to make the field type as BIGINT.
存储大于2147483647的整数的最佳选项将是使字段类型为BIGINT。
If it is for storing phone number, then way better is to store the value as a text field.
如果是存储电话号码,那么更好的方法是将值存储为文本字段。
#4
0
you can try not giving the value that starts with'0'. If you want to begin the values with zero, then use varchar datatype
你可以试着不给出以“0”开头的值。如果希望以0开始值,则使用varchar数据类型。