Really Slow connection to Mysql using ODBC (¿reverse DNS problem? RRS feed

  • Question

  • Hello.

    I made an APP which uses Mysql ODCB connector. It works perfectly when using the software and the mysql server in the same machine.

    When I did the testing of the software, I had a second PC on my LAN, and started to take a long time to connect. I googled this and it was a reverse DNS problem: I solved it by adding to the hosts file in the PC with the mysql server an entry with the IP of the other computer and the alias of this computer on the network.

    Now we have moved the mysql server to Internet, and the problem happens again. I suppose I cannot solve it by editing hosts file, as the IP of the computer with the Visual Studio app doesn't have an alias now. After searching a lot, some people says that running mysql with --skip-name-resolve solves the problem, but it is not the case.

    I can connect normally from any other MYSQL application to that server, I can ping normally, I have permissions to login to mysql... but connecting with the connector takes around 20 seconds per connection. I have tried to open the connection at the start of the execution and keeping it open and it goes a lot quicker than opening it each time the user wants to access data, but I have been told this is not the solution.

    Have you experienced this kind of problem when connecting from Windows to MySQL? How did you solve it? Thanks.

    Tuesday, April 24, 2012 11:35 PM


  • I think it may caused by network condition. If the database is on the internet, network condition is a big problem.

    Fighting like Allen Iverson. Neve give up!

    • Proposed as answer by Allen_MSDN Monday, April 30, 2012 4:46 AM
    • Marked as answer by Allen_MSDN Thursday, May 3, 2012 2:40 AM
    Thursday, April 26, 2012 6:15 AM