Bug #38388 Problem with pooled connections and MySQL 5.1
Submitted: 25 Jul 2008 22:31 Modified: 10 Apr 2009 11:25
Reporter: Graeme Wallace Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:5.X OS:Any
Assigned to: CPU Architecture:Any

[25 Jul 2008 22:31] Graeme Wallace
Description:
If a jdbc url like jdbc:mysql://hostname:3306/?options is used with the MysqlConnectionPoolDataSource any attempt to retrieve a connection will fail
with 

Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Unknown command

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:910)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3923)
at com.mysql.jdbc.MysqlIO.changeUser(MysqlIO.java:865)
at com.mysql.jdbc.ConnectionImpl.changeUser(ConnectionImpl.java:1030)
at com.mysql.jdbc.ConnectionImpl.resetServerState(ConnectionImpl.java:4550)

This works ok with Mysql 5.0.X.

How to repeat:
  public static void main(String [] args) throws Exception {

        MysqlConnectionPoolDataSource datasource = new MysqlConnectionPoolDataSource();
        datasource.setUser("xxi");
        datasource.setPassword("xxi");
        datasource.setURL("jdbc:mysql://hostname:3306/");

        MysqlPooledConnection connx = (MysqlPooledConnection) datasource.getPooledConnection();

        connx.getConnection();
    }
[29 Jul 2008 8:22] Tonci Grgin
Hi Graeme and thanks for your report.

Can you be more specific please:
  o) Which MySQL server version you're using now (4.1.x?)? Which version you want to upgrade to(5.1.x?)?
  o) Which c/J version you're using now? Which version, if any, you want to upgrade to?
  o) Which JRE version you're using now? Which version, if any, you want to upgrade to?
[29 Jul 2008 12:52] Graeme Wallace
Currently using MySQL 5.0.X want to update to 5.1.X

Using 5.1.6 version of MySQL driver. 

Using Java 1.6.0_07
[29 Jul 2008 13:45] Tonci Grgin
Graeme great, thank you.
[10 Apr 2009 11:19] Tonci Grgin
Forgot about this problem, sorry Graeme.
[10 Apr 2009 11:25] Tonci Grgin
Graeme, there is a regression test in test suite made for Bug#34937. See details about proper calls there:
	com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource ds = new
		com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource();

(or Bug#3848, Bug#4808, Bug#3920, Bug#32101, Bug#35810 and so on).
[19 Jul 2010 3:25] Yilmaz Ay
Hi
I am seeing this exact the same error with Mysql 5.5 on Windows 7 64 bit