views:

1289

answers:

4

(no responses from my identical post on the MySQL forums, so I'm hoping to have better luck here)

I'm trying to migrate a MS SQL database for a friend. I do not have physical access to the machine, nor do I have admin access -- just a read/write user.

Using "SQL Server Management Express" in XP, I can easily login using IP/user/password. I can browse tables, run queries. Easy.

When I fire up the Migration toolkit, select MS SQL, and try to connect, I get the following 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)


Any ideas? I've triple-checked the login details, no dice. Am I missing a driver? Is the server setup weird? No idea where to go from here.

Thanks in advance.

UPDATE: I downloaded and ran dbVisualizer (which also uses JDBC) and connected fine using the same SQL auth info...this tells me it's not the server, and there's no fancy MSFT stuff going on.

Still have no idea what to do next, though...

A: 

Check if your SQL server "listen" ip, tcp protocol and port 1433.

Try to execute

telnet server_ip_addres 1433

If telnet window will be closed - the SQL server doesn't listen the ip, the port or tcp. If you have an access to "SQL Server Configuration Management" or to registry of the server, you can visually find the information(Configuration Management - Protocols, TCP/IP, IP Addresses, port) and correct connection string as necessary. Just in case link to doc of jdbc driver, that you are using.

FoxyBOA
hey Foxy, thanks for the reply. 1433 is open and listening. (confirmed using the telnet string above, and checked with the admin).
jmccartie
1. Are your SQL works in "Mixed Mode" (username/password based authentication)? That mode implies in your connection string (http://msdn.microsoft.com/en-us/library/ms143705.aspx).2. Are you connection to default instance (imply in connection string as well) or to named instance (http://msdn.microsoft.com/en-us/library/ms143744(SQL.90).aspx)?
FoxyBOA
1) username/password auth is allowed -- this is how I've connected using both SQL Management and dbVisualizer. 2) print @@servername returns "DEDICATED"
jmccartie
Last idea - check that you have the latest version of jtds driver or at least that you are able to connect to the SQL using the same jdbc driver (jtds) and using the same settings.
FoxyBOA
A: 

I think there a missing rights to specific database or table of the SQL Server. I had the same problem a time ago with dts migration.

User needed read rights to the MSDB or the sysdtspackag tables.

I think your problem is similar "The list of schema names could not be retrieved" maybe your user has insufficient rights on some system tables.

Richard
Thanks, Richard. The sysadmin confirms that I have those permissions.
jmccartie
A: 

Does your connection string contain special (non alphanumeric) characters in parameter values ? If so, try urlencoding them (like / => %2f) and/or enclose them in braces {}.

streetpc
No, there are no special characters in the connection string.
jmccartie
+3  A: 

I see, there is a blog with almost the same error description

http://house9.blogspot.com/2007/12/mysql-migration-toolkit.html

Also, in order to run the tool you need access rights

master INFORMATION_SCHEMA

I would suggest executing a query (this should be done by your admin)

use [master]
GO
GRANT SELECT ON SCHEMA::[INFORMATION_SCHEMA] TO [MYUSERNAME]
GO
use [master]
GO
GRANT VIEW DEFINITION ON SCHEMA::[INFORMATION_SCHEMA] TO [MYUSERNAME]
GO

Finally, if you granted these rights, but you have the same error, then ask your system administrator to run SQL Profiler, then run your tool and see what queries it tries to execute and what SQL or security exceptions happen there (if any)

Bogdan_Ch
It's SQL Express so Profiler isn't an option
Joel Mansford
I was using the SQL express client, but the server was SQL 2000
jmccartie