Bug #45542 Cannot connect to MS SQL
Submitted: 17 Jun 2009 0:32 Modified: 24 Jun 2009 18:05
Reporter: Jon McCartie Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Migration Toolkit Severity:S2 (Serious)
Version:1.1.17 OS:Windows (XP SP2)
Assigned to: CPU Architecture:Any

[17 Jun 2009 0:32] Jon McCartie
Description:
JRE: tried 1.5.19 and 1.6.14
Windows: XP SP2
MySQL Migration Toolkit: 1.1.17

Using SQL Auth, I cannot connect to a remote MS SQL instance.  I *can* connect using the same auth info with MS SQL Management Studio and Studio Express.  I can *also* connect using DbVisualizer (jtds/jdbc) without any additional configuration info other than IP, DBName, User, and Password.

My process:
From the first page:
* Next
* Direct Migration (next)
* Database System: MS SQL Server
* Hostname (myIP) and port = 1433
* username
* password

From here I've tried to simply press "..." and have also manually entered my dbName and continued through.  Either way, I get a "login failed" error.

Here is the full error:

----

Connecting to source database and retrieve schemata names. Initializing JDBC driver ... Driver class MS SQL JDBC Driver Opening connection ... Connection jdbc:jtds:sqlserver://MYSERVERIP:1433/MYDATABASE;user=MYUSERNAME;password=MYPASSWORD;charset=utf-8;domain= The list of schema names could not be retrieved (error: 0). ReverseEngineeringMssql.getSchemata :Login failed for user 'MYUSERNAME'. Details: net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365) net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781) net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224) net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599) net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:331) net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50) net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178) java.sql.DriverManager.getConnection(Unknown Source) java.sql.DriverManager.getConnection(Unknown Source) com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:141) com.mysql.grt.modules.ReverseEngineeringMssql.getSchemata(ReverseEngineeringMssql.java:99) 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)

----

1) I consider this a bug if I cannot connect to this server instance, although a similar java-based app (dbVisualizer) can easily connect

2) I started a thread on serverfault.com, which has additional info:
http://serverfault.com/questions/26160/login-using-ms-sql-express-success-migration-toolki...

Thank you.

How to repeat:
(in description)

Suggested fix:
Update the driver?  Allow me to select my own driver?  I can't tell you since I don't know the source problem.
[17 Jun 2009 0:43] Jon McCartie
Thinking it may be a problem with the driver, I downloaded the MS SQL JDBC driver from MSFT and renamed/replaced the jtds jar file that comes with the Toolkit.

No dice there, either.  (yes, it was a desperate move)
[17 Jun 2009 16:54] Jon McCartie
Just tried this on a fresh install of Windows 7, as well.  Installed Win7, JRE 6, MySQL GUI Tools.  Login fail.  Installed dbVisualizer, login success.
[18 Jun 2009 9:54] Valeriy Kravchuk
Thank you for the problem report. What exact version of MS SQL Server do you use?
[18 Jun 2009 16:53] Jon McCartie
8.00.2039|SP4|Enterprise Edition
[24 Jun 2009 0:05] MySQL Verification Team
I couldn't repeat with MS SQL 2005.
[24 Jun 2009 18:05] Jon McCartie
This is an issue with my SQL rights.  

Please make sure what SQL Server rights are needed in order to perform a migration.  Namely, rights to INFORMATION_SCHEMA.