MySQL错误——java.sql.SQLException: Incorrect decimal value: \'\' for column \'sys_offset_seq\' a
来源:互联网 发布:淘宝店怎么吸引流量 编辑:程序博客网 时间:2024/06/07 12:29
错误名称:java.sql.SQLException: Incorrect decimal value: \'\' for column \'sys_offset_seq\' a
这种应该是版本问题,尤其是虚拟主机。
把''改成null不会出错:
insert into log values(null,'admin')
insert into log values(' ','admin')//加个空格
这种问题一般mysql 5.x上出现。我用的mysql5.1,后面查询得知新版本mysql对空值插入有"bug",要在安装mysql的时候去除默认勾选的enable strict SQL mode。如果已经安装好了的,就在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后即可。
发现以前的程序居然不能正常运行,提示信息如下:
Database error: Invalid SQL: INSERT INTO table(userId,jobId,type,action,startTime,endTime) VALUES(’17′,”,’User’,’Login’,”,’2008-11-23 14:33:56′)
MySQL error: 1366 (Incorrect integer value: ” for column ‘jobId’ at row 1)
Session halted.
第一时间的反应是跟mysql5.0新加的sql-mode有关系,因为前一阵子刚刚看过手册.果然,作了如下更改后就不再提示了.
修改 my.ini 文件.
# Set the SQL mode to strict
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
改为:
# Set the SQL mode to strict
sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
- MySQL错误——java.sql.SQLException: Incorrect decimal value: \'\' for column \'sys_offset_seq\' a
- MySql系列:中文写入数据库出现错误java.sql.SQLException: Incorrect string value: '\xE5\xxxx' for column 'xxxx' at r
- MySQL java.sql.SQLException: Incorrect string value: '\xF0\x9F\xA4\x97' for column
- mysql插入中文数据报错 java.sql.SQLException: Incorrect string value: '\xE5\x90\x88\xE8\xAE\xA1' for column
- java.sql.SQLException: Incorrect integer value: '' for column 'id' at row 1
- java.sql.SQLException: Incorrect string value: '\xE5\x90\x88\xE8\xAE\xA1' for column
- java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column 'groupName'
- java.sql.SQLException: Incorrect integer value: '' for column 'id' at row 1
- java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8E' for column 'nick' at row 1
- java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column body
- Caused by: java.sql.SQLException: Incorrect integer value: '' for column 'clientId' at row 41
- . Cause: java.sql.SQLException: Incorrect string value: '\xE6\xB5\x8B\xE8\xAF\x95' for column 'name
- java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column ...
- java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\xB3' for column 'Content' at row 1
- java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column 'title'
- mysql 错误 SQL Error: 1366: Incorrect string value: "\xE8\xAF\xA6\xE7\xBB\x86…" for column "address" a
- mysql 错误 SQL Error: 1366: Incorrect string value: "\xE8\xAF\xA6\xE7\xBB\x86…" for column "address" a
- mysql 错误 SQL Error: 1366: Incorrect string value: "\xE8\xAF\xA6\xE7\xBB\x86…" for column "address" a
- 更改myeclipse主题
- 单例模式与线程安全
- Codeforces 557C Arthur and Table【思维】
- Python脚本收集腾讯云CDN日志,并入ELK日志分析
- Linux目录处理命令
- MySQL错误——java.sql.SQLException: Incorrect decimal value: \'\' for column \'sys_offset_seq\' a
- rust compiler and tools position in relative paths
- Linux目录树
- poj 3259 Wormholes(虫洞)
- Genymotion在eclipse启动时无法找到reg.exe
- Haskell 怎样引用一个本地模块?
- 采药(0/1背包)
- Requests库入门
- Python:安装pyspider