My SQL Error: A connection attempt failed because the connected party did not properly respond

31,328

Solution 1

It means you cant connect to the server. Check your connecting to the correct ip address and your firewall is configured to allow traffic.

Solution 2

If your using "localhost" also try host name as 127.0.0.1. If its server try from mysql terminal whether that host is connecting from your local machine.

In local machine I have faced same issue with host localhost and changed to 127.0.0.1 then its works well.

Share:
31,328
Brahadeesh
Author by

Brahadeesh

A Computer Engineering grad student at Stony Brook University. My passions are machine learning and android programming.

Updated on July 09, 2022

Comments

  • Brahadeesh
    Brahadeesh almost 2 years

    I have a MySQL database in a 3rd party server. I am trying to access it from my local machine using php in dreamweaver. However, I am getting the following error:

    MySQL Error #2002:
    A connection attempt failed because the connected party did not properly respond 
    after a period of time, or established connection failed because connected host 
    failed to respond.
    

    I realize I might not have given all the details. I am a beginner and will get the details if required. Thank you.

  • Rahul
    Rahul almost 13 years
    This should be a comment rather an answer
  • Tom Squires
    Tom Squires almost 13 years
    @Rahul Why? It gives what i think the problem is and one way of solving it.
  • Tom Squires
    Tom Squires almost 13 years
    Try telneting to that address ( telnet ip port (default 3306))
  • Tom Squires
    Tom Squires almost 13 years
    Yes type that in command prompt. You may need to install telnet windows.microsoft.com/en-US/windows-vista/…
  • Nevermore
    Nevermore over 8 years
    @TomSquires It doesn't help me. I am getting return packets from my destination IP and I configured my firewall to allow traffic still it shows me .." A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."