MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT’

本文解决了一个MySQL访问时出现的语法错误问题,该错误源于使用了过时的SET OPTION SQL_SELECT_LIMIT=DEFAULT命令。文章提供了更新JDBC驱动的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我在遇到了数据库访问时错误,具体如下:

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


查了下之后类似OPTION SQL_SELECT_LIMIT=DEFAULT 都是一个mysql的BUG:

That looks like an error coming from a JDBC driver. When the JDBC driver initializes the connection, it sends several commands to the MySQL server, one of which is:

SET OPTION SQL_SELECT_LIMIT=DEFAULT

The problem is that the SET OPTION syntax has been deprecated for some time and is now no longer valid in MySQL 5.6. Here's a relevant bug conversation from MySQL's bug database:

Bug #66659: mysql 5.6.6m9 fails on OPTION SQL_SELECT_LIMIT=DEFAULT

Try upgrading your JDBC MySQL driver. The bug conversation lists some other options in case upgrading the driver is not an option.

具体问题链接:https://netbeans.org/bugzilla/show_bug.cgi?id=224260


解决办法:下载最新的JDBC驱动jar包替换你原来的jar包即可,链接如下:

http://dev.mysql.com/downloads/file.php?id=412737


见附件也可以


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值