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

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

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


见附件也可以


你可能感兴趣的:(mysql)