Home > Database > Mysql Tutorial > 【mysql案例】Java程序访问Mysql报错'OPTION SQL

【mysql案例】Java程序访问Mysql报错'OPTION SQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:18:44
Original
1091 people have browsed it

【环境描述】 mysql版本: 5.6.14-56-log Percona Server (GPL) 程序: 使用JDBC驱动mysql-connector-java访问mysql数据库 【报错信息】 程序访问mysql执行SQL语句的时候报错: You have an error in your SQL syntax; check the manual that corresponds to

【环境描述】

mysql版本: 5.6.14-56-log Percona Server (GPL)

程序: 使用JDBC驱动mysql-connector-java访问mysql数据库


【报错信息】

程序访问mysql执行SQL语句的时候报错:

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 'OPTION SQL_SELECT_LIMIT=5' at line 1

【报错原因】
程序使用的JDBC驱动版本跟MySQL5.6版本不兼容

【解决方法】
升级mysql-connector-java驱动

测试set OPTION SQL_SELECT_LIMIT=5 不再报错。


总结:

使用新版本MySQL的时候,不仅数据库要进行测试,也要结合程序一起进行测试。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template