MySQL升级到5.0.17后,在执行sql语句
INSERT INTO `news` (`ID`, `Title`, `Content`) VALUES ('', '标题', '正文');
时出现错误:
#1264 - Out of range value adjusted for column 'ID' at row 1

原因:
新版本的MySQL对字段的严格检查。

解决方法:
修改my.ini,将
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
改为
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"。
重新启动MySQL。

2006-04-02备注:
以后写sql语句时,类型和值最好严格一些。


分享到饭否

PHP | 评论(2) | 引用(1) | 阅读(6456)
ad
2008/07/21 17:08
pig
蒯义刚 Email Homepage
2006/05/21 12:11
今天发现有人转了我的这篇blog,地址:
http://s03656.stu.cdut.edu.cn/bbs/index.php?mods=topicdisplay&forumid=2&postid=1&p=1
grin
分页: 1/1 第一页 [1] 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 请输入左侧的字母,不区分大小写