Java321技术网

标题: centos系统1366:Incorrect integer value: '' for column 'id' at row 1 [打印本页]

作者: luozhangyou    时间: 2018-1-2 03:24
标题: centos系统1366:Incorrect integer value: '' for column 'id' at row 1

在使用Navicat for MySQL还原数据库备份时,出现Incorrect integer value: '' for column 'id' at row 1的错误;

网上查资料发现5以上的版本如果是空值应该要写NULL
这种问题一般mysql 5.x上出现。

使用Select version();查看,

我用的是mysql5.0.37,而创建备份的MySQL数据库版本是5.6

官方解释说:得知新版本mysql对空值插入有"bug",
要在安装mysql的时候去除默认勾选的enable strict SQL mode
那么如果我们安装好了mysql怎么办了,解决办法是更改mysql中的配置 my.ini

  1. my.ini中查找sql-mode,  
  2.   
  3. 默认为sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",  
  4.   
  5. 将其修改为sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",重启mysql后即可  
复制代码








欢迎光临 Java321技术网 (https://java321.com/) Powered by Discuz! X3.3