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 questionI 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
orSTRICT_ALL_TABLES
is enabled.
精彩评论