• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2221
  • Last Modified:

MySQL ODBC Connection Fails?

Hi All,

I have got windows machine with ODBC 3.51 Driver installed. I'm trying to connect MySQL 5.0.51 installed on Linux machine (remote location).

When I try to create DSN I see error like below

Connection Failed: [HY000][MySQL][ODBC 3.51 Driver] Unknown MySQL Server host '{prodserver}' (0)

Open in new window

Please can any one help me to fill some thoughts?

Is that anything with ODBC driver version problem? I'm connecting to MySQL 5.0.51 with ODBC 3.51 driver?
  • 4
1 Solution
Pratima PharandeCommented:
You should read the MySQL documentation on the access privilege system:

And also the reference documentation on the statements used to administer
accounts and grant privileges:

So basically you need to grant privilege to some account on your PC to
connect to one or more databases. For example:

GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'bsanderson' IDENTIFIED
BY 'password';

refer for more details
yarabatiAuthor Commented:
Thanks for the response pratima.

Permissions are absolutely fine. I have had GRANT ALL ON *.* TO user@'%' IDENTIFIED BY 'sec1234'.

* the top 2 links you given seems to be broken, redirecting to Oracle search site.
you could test the connection to the mysql database manually.

e.g mysql -h prodserver.somedomain.com -u user -p pass123

or alternatively via a tool such as heidsql so you can make sure your pc can connect the mysql server. This way you rule out any issues with the connection /  network.

Also, are you able to connect the mysql server from other remote machines? If not you may need to configure the mysql server to be bound to public ips:

comment out bind_address = in /etc/mysql/my.cnf
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

yarabatiAuthor Commented:
Aegil, Thanks for the response.

I'm able to connect mysql server from other machines. This is perfect.
yarabatiAuthor Commented:
Thank you very much akaodin.

As I suspect, the problem is with the versions. Looks like ODBC driver 3.51 is not compatible to connect MySQL 5.x versions. I have got ODBC driver 5.1 and it worked like charm.

Thanks all who tried help me out.

yarabatiAuthor Commented:
It was version problem as I suspect. But no one from here confirm me, so closing the post by accepting my response itself

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now