第1列的"xxxx"列的数据已被截断 [英] Data truncated for column 'xxxx' at row 1

查看:424
本文介绍了第1列的"xxxx"列的数据已被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将php站点移到了新服务器上.我的查询之一失败,显示Data truncated for column 'xxx' ar row 1消息.我检查了此字段是否为浮点(10,6)类型.而且我提供的白色更新值不完全是float(10,6)格式,并且它们变化..就像有时我只输入0或仅输入54.56666 ..所以,我知道如何将其排序吗?

I have just moved a php site to a new server. One of my queries is failing with Data truncated for column 'xxx' ar row 1 message. I checked that this field is float (10,6) type. And the values I provided white updating are not of exactly float(10,6) format and they vary .. like sometimes I put 0 only, or 54.56666 only .. so any idea how do I sort it out??

PS: 在较早的服务器上,一切正常.此新服务器具有不同(较新)的mysql版本.我不想对mysql配置进行任何更改.

PS: On the earlier server, everything was working ok. This new server has different (newer) version of mysql. I don't want to make any changes to the mysql config.

推荐答案

您试图输入的数据长度超出了列定义的允许范围.请提供您用于我们查看的查询.另外,搜索错误消息还会产生:

You tried to put in data that was longer than what your column definitions allow. Please provide the queries you used for us to see. In addition googling the error message yielded:

  • http://forums.mysql.com/read.php?11,132672,132672#msg-132672
  • http://forums.mysql.com/read.php?11,132672,132693#msg-132693
  • http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html

建议的解决方案是修改服务器的严格模式"设置:

The suggested solution there is to modify the server's "strict mode" setting:

本手册中的严格模式"指的是至少启用了STRICT_TRANS_TABLESSTRICT_ALL_TABLES之一的模式.

When this manual refers to "strict mode," it means a mode where at least one of STRICT_TRANS_TABLES or STRICT_ALL_TABLES is enabled.

这篇关于第1列的"xxxx"列的数据已被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆