开发者

Data truncated for column 'xxxx' at row 1 [closed]

开发者 https://www.devze.com 2022-12-20 08:01 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist

开发者_JAVA技巧

Closed 9 years ago.

Improve this question

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: 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.


Also, if you have an enum and you insert a value not present in the enum you can see this error.


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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消