一次 Mysql 字符集的报错,最后让我万马奔腾!!!
wuba---深圳---龙岗周边----3000元---------
wuba---深圳---龙岗周边----5000元---------
wuba---深圳---龙岗周边----8000元---------
wuba---深圳---龙岗周边----1000元---------
wuba---深圳---龙岗周边---600元以下---------
wuba---深圳---龙岗周边---8000元以上---------
Mon Jan :: CST 2018Insert Danke check data inserted
java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range,num) values('','wuba','深圳','龙岗周边','8000元以上',36)' at line
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:)
at util.InsertIntoMysql.InsertDankeCheck(InsertIntoMysql.java:)
at Info.Xx_Danke.Xx_DankeRank(Xx_Danke.java:)
at Info.Xx_Danke.main(Xx_Danke.java:)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range,num) values('','wuba','深圳','龙岗周边','8000元以上',36)' at line
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.Util.getInstance(Util.java:)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:)
... more
开始以为是字符集的错误,各种找原因,看JDBC连接参数。。。
试了N种方法之后,直接用代码传入定值,结果依旧。当时马上就知道了,表出问题了。。。
复制了一个可以用的表,然后改结构,重试。依然报这个错。
再复制insert语句到navicat中,结果还是报错。。。 目标定到了我的‘’range‘’字段
insert into danke_check(day,site,city,street,range,num) values ('2017-10-20','anjuke','深圳','龙门县','500-8000元',20)
insert into danke_check(day,site,city,street,range_num,num) values ('2017-10-20','anjuke','深圳','龙门县','500-8000元',20)
当时range字段是蓝色字体,好像心里就明白了。
把range改成range_num 插入完成。
顿时,万马奔腾!!!!!!!!!!!!!!!不是第一次了,也差不多是第二次了,range是关键词!!!!!
2018年1月23日10:14:13
记录一下
一次 Mysql 字符集的报错,最后让我万马奔腾!!!的更多相关文章
- CentOS命令登录MySQL时,报错ERROR 1045 (28000):
CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解 ...
- mysql执行update报错1175解决方法
mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...
- Mysql update in报错 [Err] 1093 - You can't specify target table 'company_info' for update in FROM clause
Mysql update in报错 解决方案: [Err] 1093 - You can't specify target table 'company_info' for update in FRO ...
- mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY
mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...
- MySQL主从1205报错【转】
主从报错1205 Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the va ...
- 远程登陆linux连接mysql root账号报错:2003-can't connect to MYSQL serve(转)
远程连接mysql root账号报错:2003-can't connect to MYSQL serve 1.远程连接Linux系统,登录数据库:mysql -uroot -p(密码) 2.修改roo ...
- 远程连接mysql root账号报错:2003-can't connect to MYSQL serve(转)
远程连接mysql root账号报错:2003-can't connect to MYSQL serve 1.远程连接Linux系统,登录数据库:mysql -uroot -p(密码) 2.修改roo ...
- MySQL数据源驱动报错
报错信息:MySQL数据源驱动报错: 1.mysql8.0以上版本需要连接数据库的JDBC驱动也是8.0版本以上 com.mysql.cj.jdbc.Driver 2.MySQL高版本需要指明是否需要 ...
- Linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) "
前言 作者在2021-07-21时遇到 linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localh ...
随机推荐
- brew: Nginx https config
下载安装Brew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/mas ...
- L144
Puny Dwarf Planet, Named 'Goblin,' Found Far Beyond PlutoA scrawny dwarf planet nicknamed "the ...
- html 压缩成一行
文章java gulp-htmlmin 减少下载的时间
- 关于linux 编程
emacs 编辑器 gcc/g++ 编译器 gdb 调试工具 valgrind 内存泄露检查 doxygen 文档组织工具
- 《Drools7.0.0.Final规则引擎教程》第4章 4.1 规则文件
一个标准的规则文件的格式为已".drl"结尾的文本文件,因此可以通过记事本工具进行编辑.规则放置于规则文件当中,一个规则文件可以放置多条规则.在规则文件当中也可以存放用户自定义的函 ...
- js类 的小例子
class Flyer { constructor(fname, speed) { this.fname = fname; this.speed = speed; } fly(){ console.l ...
- eclipse 智能提示js和jquery等前端插件
使用Eclipse写Jquery和Javascript代码的时候,是没有智能提示的.我们可以使用一个插件来解决这个问题. 安装完成后,Eclipse会自动重启.重启之后,我们在项目上右键, 根据自 ...
- easyui1.4 汉化出问题
easyui 1.4 的textbox 验证汉化不了,需要在easyui-lang-zh_CN.js 加入 if ($.fn.textbox){ $.fn.textbox.defaults.missi ...
- iOS6和iOS7代码的适配(5)——popOver
popOver这个空间本身是iPad only的,所以iPhone上见不到,我记得微信上有个这样的弹出框,有扫一扫等几个菜单项,估计这是腾讯自己实现的,用于菜单的扩展. popOver从iOS6到iO ...
- selenium - 截取页面图片和截取某个元素的图
1.截取页面图片并保存 在测试过程中,是有必要截图,特别是遇到错误的时候进行截图. # coding:utf-8 from time import sleep from PIL import Imag ...