Connection failed, Access denied connecting to MySQL via ODBC on Windows

2

I know nothing about MySQL or Linux and am tasked with migrating a MySQL DB to MS SQL. I found a tool for that but it requires an ODBC connection so I downloaded the MySQL Connector/ODBC and installed it. I am not trying to connect to the server but when I test the connection I get:

enter image description here

I found this post on SO https://stackoverflow.com/questions/5016505/mysql-grant-all-privileges-on-database and rand it on the Linux machine replacing the username with the one in the error message (redacted from the screen shot for security).

I know I am using the right user and password as I was able to putty to the Linux machine and get into MySQL with no problem. I have done some googling and most of the results are about resetting the password, though my google skills are not that good.

What am I missing so I can connect to the machine from windows and do the data migration?

Matthew Verstraete

Posted 2015-12-18T18:25:21.637

Reputation: 406

Did you see this: https://msdn.microsoft.com/en-us/library/hh313137(v=sql.110).aspx? What version of Microsoft SQL Server are you running? Does the built-in MS ODBC connector not allow ODBC connections with it rather than using the MySQL one you had to install onto Windows? I've never connected from Windows to MySQL with the built-in Window ODBC so I figured I'd ask. The article is just FYI in case it make more sense to migrate to SQL via that method instead unless that's what you're already doing and this is one of those steps in that process.

– GambleNerd – 2015-12-18T18:51:32.600

I will be using SSMA (which is what your link talks about) but I still need to establish a ODBC connection but I can't due to the error as shown. – Matthew Verstraete – 2015-12-18T19:11:48.160

I noticed you are a member of the dba.stackexchange community or group so wondering if you thought about asking this question there as I'm sure they'll have people more well versed in RDBMS systems that'll give a quicker answer or help given 4 hours has passed and no one here can assist. I know a little about ODBC and MSSQL but not MySQL or this add-on tool. To me the error message indicates the connection failed like the wrong port number/IP but then access denied for user seems like that account cannot access something like the connection didn't fail so I have no idea and no way to test it. – GambleNerd – 2015-12-18T22:44:04.243

Answers

0

I ended up having to run the following

GRANT ALL PRIVILEGES ON *.* to 'root'@'REMOTEHOSTNAME' IDENTIFIED BY 'ROOTUSERPASSWORD';

Matthew Verstraete

Posted 2015-12-18T18:25:21.637

Reputation: 406