3/02/2013

MySQLSyntaxErrorException regarding OPTION SQL_SELECT_LIMIT=DEFAULT

Have you ever experienced an Exception like this :



com.mysql.jdbc.exceptions.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=DEFAULT' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3250)
at com.mysql.jdbc.Connection.unsetMaxRows(Connection.java:5820)
at com.mysql.jdbc.Statement.realClose(Statement.java:2023)
at com.mysql.jdbc.PreparedStatement.realClose(PreparedStatement.java:2185)
at com.mysql.jdbc.PreparedStatement.close(PreparedStatement.java:687)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.close(NewProxyPreparedStatement.java:1811)


If so, then it might be because you have Mysql 5.6 installed. To fix this, simply download the jar you find on this page :
http://www.mysql.de/downloads/mirror.php?id=412054
and replace the "mysql.jar" in your lib/ext directory. That should be all.


If you like this post it would be very nice, if you could visit this page: http://www.michaltryka.pl/en/

It is about a 2 year old boy with cancer whose parents are struggling to finance the funds for a treatment for their son. Please go there and help !

If you have any questions, feel free to leave a comment.