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 字符集的报错,最后让我万马奔腾!!!的更多相关文章

  1. CentOS命令登录MySQL时,报错ERROR 1045 (28000):

    CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解 ...

  2. mysql执行update报错1175解决方法

    mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...

  3. 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 ...

  4. 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 今天开发的同事发来如下错误信息,最最简 ...

  5. MySQL主从1205报错【转】

    主从报错1205 Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the va ...

  6. 远程登陆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 ...

  7. 远程连接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 ...

  8. MySQL数据源驱动报错

    报错信息:MySQL数据源驱动报错: 1.mysql8.0以上版本需要连接数据库的JDBC驱动也是8.0版本以上 com.mysql.cj.jdbc.Driver 2.MySQL高版本需要指明是否需要 ...

  9. 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 ...

随机推荐

  1. javascript: what can javascript do?

    1.Javascript can change html content <!DOCTYPE html> <html> <body> <h2>What ...

  2. Django的model查询操作 与 查询性能优化

    Django的model查询操作 与 查询性能优化 1 如何 在做ORM查询时 查看SQl的执行情况 (1) 最底层的 django.db.connection 在 django shell 中使用 ...

  3. Redis 补充

    Redis 补充 Redis 的主要用途 数据库 缓存和消息中间件 相当于一个字典 数据库切换 select 1 (默认36个数据库 默认在0) 1 基本数据类型 字符串 散列 hashes 列表 集 ...

  4. Django应用部署

    前言 Apachewsgi 环境搭建 安装Apache 安装mod_wsgi 添加djangowsgi文件 配置etcapache2httpdconf wsgipy配置 跑起来吧 uWSGI 环境搭建 ...

  5. Azure VM Scalable Sets -- 适用IAAS架构

    1. 选择Virtual Machine scale set2. 选择resource manager(或创建最新)3. 基本信息配置4. 配置scale的参数(可伸缩的balance模型):VM最小 ...

  6. pg_buffercache

    查看缓冲区缓存的内容: create extension pg_buffercache; select c.relname, count(1) as buffers from pg_class c j ...

  7. Developing on Windows Phone 8 Devices

    Developing on Windows Phone 8 Deviceshttp://docs.madewithmarmalade.com/native/platformguides/wp8guid ...

  8. 阿里云,腾讯云,等等的云 Ubuntu14.04升级16.04

    16.04有很多好处.在此不说了 这几天来回折腾了各种的云,然后发现国内的都没有16.04 但是ubuntu可以直接在线升级 在此记下来升级的过程 不管是腾讯云也好 阿里云也好,或者别的什么云,只要是 ...

  9. php之opcodes

    opcode是一种php脚本编译之后的语言. 例如: <?php echo "Hello World"; $a = 1 + 1; echo $a; ?> php执行这段 ...

  10. win10 135/445端口关闭

    135端口关闭 见[在 Windows 下关闭135/139/445端口的图文方法] 445端口关闭 打开控制面板-->网络和共享中心-->更改适配器设置-->右键点击正在使用的网卡 ...