MySQL错误1264:超出列的范围值

时间:2022-06-01 16:03:01

As I SET cust_fax in a table in MySQL like this:

当我在MySQL中的表中设置cust_fax时,如下所示:

cust_fax integer(10) NOT NULL,

and then I insert value like this:

然后像这样插入值:

INSERT INTO database values ('3172978990');

but then it say

但是它说

`error 1264` out of value for column

“error 1264”为列的值

And I want to know where the error is? My set? Or other?

我想知道误差在哪里?我准备好了吗?或其他?

Any answer will be appreciated!

如有任何答复,我们将不胜感激!

4 个解决方案

#1


45  

The integer 3172978990 is greater than 2147483647, hence the error**.

整数3172978990大于2147483647,因此出现错误**。

To fix the error, change your datatype to VARCHAR. Phone, Fax etc. should be stored as strings. See this discussion.

要修复错误,请将数据类型更改为VARCHAR。电话、传真等应以字符串形式保存。看到这个讨论。

** Here is a chart that tells you which integer type can store what values.

这里有一个图表,告诉您哪个整数类型可以存储什么值。

#2


7  

You are exceeding the length of int datatype. You can use UNSIGNED attribute to support that value.

您正在超过int数据类型的长度。您可以使用UNSIGNED属性来支持该值。

SIGNED INT can support till 2147483647 and with UNSIGNED INT allows double than this. After this you still want to save data than use CHAR or VARCHAR with length 10

有符号INT可以支持到2147483647,无符号INT可以支持两倍。在此之后,您仍然需要保存数据,而不是使用长度为10的CHAR或VARCHAR

#3


7  

you Can also change the data type to bigInt and it will solve your problem, it's not a good practice to keep integers as strings unless needed. :)

您还可以将数据类型更改为bigInt,这将解决您的问题,除非需要,否则不应该将整数保存为字符串。:)

ALTER TABLE T_PERSON MODIFY mobile_no BIGINT;

修改表T_PERSON修改mobile_no BIGINT;

#4


0  

Use unsigned. int = from -2 147 483 648 to 2 147 483 647

使用无符号。int =从-2 147 483 648到2 147 483 647

#1


45  

The integer 3172978990 is greater than 2147483647, hence the error**.

整数3172978990大于2147483647,因此出现错误**。

To fix the error, change your datatype to VARCHAR. Phone, Fax etc. should be stored as strings. See this discussion.

要修复错误,请将数据类型更改为VARCHAR。电话、传真等应以字符串形式保存。看到这个讨论。

** Here is a chart that tells you which integer type can store what values.

这里有一个图表,告诉您哪个整数类型可以存储什么值。

#2


7  

You are exceeding the length of int datatype. You can use UNSIGNED attribute to support that value.

您正在超过int数据类型的长度。您可以使用UNSIGNED属性来支持该值。

SIGNED INT can support till 2147483647 and with UNSIGNED INT allows double than this. After this you still want to save data than use CHAR or VARCHAR with length 10

有符号INT可以支持到2147483647,无符号INT可以支持两倍。在此之后,您仍然需要保存数据,而不是使用长度为10的CHAR或VARCHAR

#3


7  

you Can also change the data type to bigInt and it will solve your problem, it's not a good practice to keep integers as strings unless needed. :)

您还可以将数据类型更改为bigInt,这将解决您的问题,除非需要,否则不应该将整数保存为字符串。:)

ALTER TABLE T_PERSON MODIFY mobile_no BIGINT;

修改表T_PERSON修改mobile_no BIGINT;

#4


0  

Use unsigned. int = from -2 147 483 648 to 2 147 483 647

使用无符号。int =从-2 147 483 648到2 147 483 647