最近自己在测试一个开源的程序,测试中发现。该程序都添加和更新的时候回出现 Incorrect integer value: '' for column 'id' at row 1类是的错误!

后来我自己测试了一下:

insert into log values('','admin','31','002t')

这样写就会报错: Incorrect integer value: '' for column 'id' at row 1

一般我们是认为应该没错误的。后来查了下MYSQL的资料。发现5以上的版本如果是空值应该要写NULL

这种问题一般mysql 5.x上出现。我用的mysql5.1

官方解释说:得知新版本mysql对空值插入有"bug",要在安装mysql的时候去除默认勾选的enable strict SQL mode

那么如果我们安装好了mysql怎么办了,解决办法是更改mysql中的配置 my.ini

my.ini中查找sql-mode,

默认为sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",

将其修改为sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",重启mysql后即可

那么如果是虚拟主机或者是空间怎么办了。如果你能让空间商帮你改那是最好。如果不能,那你就只能程序改改。都规范一点。空值就写 null

其实最后的结果是表没建成功,我后来是换了一软件可以了

kettle 遇到 解决Incorrect integer value: '' for column 'id' at row 1 完美解决-费元星的更多相关文章

  1. Incorrect integer value: '' for column 'id' at row 1 错误解决办法

    最近一个项目,在本地php环境里一切正常,ftp上传到虚拟空间后,当执行更新操作(我的目的是为了设置id为空)set id=‘’时提示: Incorrect integer value: '' for ...

  2. Incorrect integer value: '' for column 'id' at row 1

    最近在写个查询 插入语句的时候 我是这么写的 insert into test values('',$row[contentid],'".$tn."'); 结果搞死没插入进去  然 ...

  3. sql语句执行出错:Incorrect integer value: '' for column 'id' at row 1

    经检验:mysql5以上的版本如果是空值应该要写NULL. 例如:insert into web_works (work_id,work_name,work_number) values ('','$ ...

  4. Msql:Incorrect double value: ''for column 'id' at row 1解决

    Incorrect double value: ''for column 'id' at row 1解决   最近在写个查询 插入语句的时候 我是这么写的 1 insert into test val ...

  5. Caused by: java.sql.SQLException: Incorrect integer value: '' for column 'clientId' at row 41

    1.错误描述 [ERROR:]2015-06-10 13:48:26,253 [异常拦截] oa.exception.ExceptionHandler org.hibernate.exception. ...

  6. Incorrect integer value: '' for column 'mid' at row 11366Incorrect integer value: '' for column 'mid' at row 1,自增字段为空,添加记录时出错

    在本地机器做测试时,数据可以正常添加,但是将代码放置到服务器上时,提示:Incorrect integer value: '' for column 'mid' at row 11366Incorre ...

  7. Incorrect integer value: '' for column 'RegNum' at row 1

    数据库版本: 5.6.16​​操作系统: Red Hat Enterprise Linux Server release 6.3 (Santiago)​​在插入数据的时候提示告警:​mysql> ...

  8. 解决Incorrect integer value: '' for column 'id' at row 1的方法

    在使用Navicat for MySQL还原数据库备份时.出现Incorrect integer value: '' for column 'id' at row 1的错误; 网上查资料发现5以上的版 ...

  9. incorrect integer value for column 问题解决

    最近在用zend框架,然后装了一个项目,发现注册的时候出现 General error: 1366 Incorrect integer value: '' for column 'user_id' a ...

随机推荐

  1. Bootstrap Table的使用小结

    1.Jquery中的一些东西学习一下子,补充完善一下,毕竟有些时候没有使用到 这个方式很有用,在使用bootstrap table的时候,选择当前已经选择的节点的事件中的ID的值 当前rows中有很多 ...

  2. HDU 1754 I Hate It 【线段树单点修改 维护区间最大值】

    题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1754 I Hate It Time Limit: 9000/3000 MS (Java/Others ...

  3. POJ 3621 Sightseeing Cows 【01分数规划+spfa判正环】

    题目链接:http://poj.org/problem?id=3621 Sightseeing Cows Time Limit: 1000MS   Memory Limit: 65536K Total ...

  4. doppia代码支持

    stixels_t在stixel.hpp里,存储class stixel的vector

  5. ASP.NET整体运行机制+asp.net请求管道+页面生命周期

  6. 【洛谷P2921】[USACO08DEC]在农场万圣节

    在农场万圣节Trick or Treat on the Farm 题目链接 题解:首先,将原图缩点,变为DAG, 然后在DAG上记忆化搜索即可 #include<iostream> #in ...

  7. c# 常见验证邮箱、电话号码、日期等格式

    #region 验证邮箱验证邮箱 /**//// <summary> /// 验证邮箱 /// </summary> /// <param name="sour ...

  8. HDU 1226 超级密码(数学 bfs)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1226 超级密码 Time Limit: 20000/10000 MS (Java/Others)    ...

  9. Integer大小比较问题

    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException { Integer ...

  10. foreach, for in, for of 之间的异同

    forEach() 方法用于调用数组的每个元素,并将元素传递给回调函数. 注意: forEach() 对于空数组是不会执行回调函数的. 示例代码: var arr = [4, 9, 16, 25]; ...