MySQL ODBC Connection Fails?

Posted on 2011-10-11
Last Modified: 2012-05-12
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?
Question by:yarabati
    LVL 39

    Expert Comment

    by:Pratima Pharande
    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

    Author Comment

    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.
    LVL 8

    Expert Comment

    you could test the connection to the mysql database manually.

    e.g mysql -h -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

    Author Comment

    Aegil, Thanks for the response.

    I'm able to connect mysql server from other machines. This is perfect.

    Accepted Solution

    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.


    Author Closing Comment

    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

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now