MySQL Error 1264: out of range value for column(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:列值超出范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:MySQL 错误 1264:列值超出范围


- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- SQL 临时表问题 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01