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

编程入门 行业动态 更新时间:2024-10-26 06:39:30
本文介绍了MySQL 错误 1264:列的值超出范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

cust_fax integer(10) NOT NULL,

然后我像这样插入值:

INSERT INTO database values ('3172978990');

然后它说

`error 1264` 列值不足

`error 1264` out of value for column

我想知道错误在哪里?我的一套?还是其他?

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

任何答案将不胜感激!

推荐答案

值 3172978990 大于 2147483647 - INT 的最大值 - 因此出现错误.MySQL 整数类型及其范围在此处列出.

The value 3172978990 is greater than 2147483647 – the maximum value for INT – hence the error. MySQL integer types and their ranges are listed here.

还要注意INT(10) 中的(10) 没有定义整数的大小".它指定列的显示宽度.此信息仅供参考.

Also note that the (10) in INT(10) does not define the "size" of an integer. It specifies the display width of the column. This information is advisory only.

要修复错误,请将您的数据类型更改为 VARCHAR.电话和传真号码应存储为字符串.请参阅此讨论.

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

更多推荐

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

本文发布于:2023-10-18 10:37:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1503984.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   MySQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!