My SQL Error: A connection attempt failed because

2019-06-07 18:04发布

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.

2条回答
Deceive 欺骗
2楼-- · 2019-06-07 18:51

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.

查看更多
迷人小祖宗
3楼-- · 2019-06-07 19:04

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

查看更多
登录 后发表回答