Bug #26790 Mysql JDBC connection fails
Submitted: 2 Mar 2007 11:36 Modified: 2 Mar 2007 13:14
Reporter: Cédric Duprez Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Migration Toolkit Severity:S2 (Serious)
Version:1.1.10 OS:Windows (Windows XP SP1)
Assigned to: CPU Architecture:Any

[2 Mar 2007 11:36] Cédric Duprez
Description:
Hi,

I'm using MySQL 5.0.33, with Mysql Migration Toolkit 1.1.10.
My JRE version is 5.0_06.

The migration toolkit fails to connect to the mysql server through mysql JDBC Driver 5.0 and returns the following error:
Connection jdbc:mysql://127.0.0.1:3306/?user=root&password=cedric&useServerPrepStmts=false&characterEncoding=UTF-8
The connection to the target database could not be established (error: 0).
ReverseEngineeringMysqlJdbc.getVersion :Unknown initial character set index '48' received from server. Initial client character set can be forced via the 'characterEncoding' property.
Details: 
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java:2345)
com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3913)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2683)
com.mysql.jdbc.Connection.<init>(Connection.java:1531)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:101)
com.mysql.grt.modules.ReverseEngineeringGeneric.getVersion(ReverseEngineeringGeneric.java:121)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.grt.Grt.callModuleFunction(Unknown Source)

I have tried several JRE versions (5.0_02 and 5.0_11) without success.

How to repeat:
Install the same MySQL version 5.0.33
Install the migration toolkit 1.1.10

The connection fails
[2 Mar 2007 12:46] Cédric Duprez
Same error with MySQL 5.0.27
[2 Mar 2007 12:52] Cédric Duprez
Here is the error I get when I try to change the encoding character manually (to latin1) :
Connection mysql://127.0.0.1:3306/?user=root&password=&useServerPrepStmts=false&characterEncoding=latin1
The connection to the target database could not be established (error: 0).
ReverseEngineeringMysqlJdbc.getVersion :No suitable driver
Details: 
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:101)
com.mysql.grt.modules.ReverseEngineeringGeneric.getVersion(ReverseEngineeringGeneric.java:121)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.grt.Grt.callModuleFunction(Unknown Source)
[2 Mar 2007 13:00] MySQL Verification Team
Thank you for the bug report. I was unable to repeat this issue:

Connecting to source database and retrieve schemata names.
Initializing JDBC driver ... 
Driver class MySQL JDBC Driver 5.0
Opening connection ... 
Connection jdbc:mysql://127.0.0.1:3307/?user=root&password=&useServerPrepStmts=false&characterEncoding=UTF-8
Fetching schemata list.
SHOW DATABASES
Return schemata list.
Schemata names retrieved successfully.
Initializing JDBC driver ... 
Driver class MySQL JDBC Driver 5.0
Opening connection ... 
Connection jdbc:mysql://127.0.0.1:3306/?user=root&password=&useServerPrepStmts=false&characterEncoding=UTF-8
Getting version information ... 
Initializing JDBC driver ... 
Driver class MySQL JDBC Driver 5.0
[2 Mar 2007 13:14] Cédric Duprez
After a re-installation with the msi installer, everything is normal.
The problem came from a zip installation.

Thanks