问题
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.
回答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.
回答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.
来源:https://stackoverflow.com/questions/6818104/my-sql-error-a-connection-attempt-failed-because-the-connected-party-did-not-pr