No connection could be made because the target machine actively refused it

Report
-
 LaurieC -
Hi,
I program a small web site for my Golf Club www.vetsgolfvic.org.au
For years I have used VS.PHP 3.8 to write and test the PHP code on my home computer and have used WAMP and Notepad++ on a laptop in order to interact with a MySQL database.
Not following some Windows 10 updates I'm getting the above error message and despite several searches and attempts to modify the behaviour of Windows Firewall (which seems to be the vaguely understood cause of this problem) I cannot find away around this dilemma.

6 replies

Go to your database management console. Open up the security settings on the db. Give the web service that is running the web application on your web server permissions to connect login and read the db.
4
Thank you

Glad we were able to help! Love us? Write us a review! Rate CCM

CCM 2832 users have said thank you to us this month

Posts
8964
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
September 13, 2020
988
Hi,

Have you tried to add the program and its ports to the firewall exceptions?
Posts
8964
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
September 13, 2020
988
Also check if your internet connection doesn't use a proxy server. If this is the case, disable that connection.
>
Posts
8964
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
September 13, 2020

For what I'm doing in the testing everything is on my computer. So I don't understand why my internet connection would or would not be using a proxy server. If so how would I check?
Posts
8964
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
September 13, 2020
988 > LaurieC
Some servers cannot communicate properly, especially if you use a proxy server. Open the start menu and go to Settings > Network & Internet > Proxy.

Then enable Automatically detect settings and disable Use a proxy server.
Hi,
Thanks. I've done that and found the settings were as you advised.

Now What?
I still get the same message when attempting to communicate with the MySQL database. As the settings were unchanged I di not really expect their to be a difference
Does the web server have permissions I to the database?
It is acting like it doesn't. That seems to be the purport of the error message. However, how do I check that? And how do I give it permission?
Posts
1
Registration date
Wednesday February 26, 2020
Status
Member
Last seen
February 26, 2020

This error is a network-related error occurred while establishing a connection to the Server. It means that the error is occurring because there is no server listening at the hostname and port you assigned. It happens that something is preventing a connection to the port or hostname. Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that specific port. This may be because it is not running at all or because it is listening on a different port. So, no connection can be established. The solution to this problem is that connect to the same end point your server is listening on.
Posts
1
Registration date
Monday February 24, 2020
Status
Member
Last seen
February 27, 2020

Hi,
"Actively refused it" means that the host sent a reset instead of an ack when you tried to connect. It is therefore not a problem in your code. Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that port, this may be because it is not running at all or because it is listening on a different port.

once you start the process hosting your service try netstat -anb (requires admin privileges) to verify that it is running and listening on the expected port.

Refer these links:
http://forums.asp.net/t/1223846.aspx
http://stackoverflow.com/questions/2972600/no-connection-could-be-made-because-the-target-machine-actively-refused-it
Hi,

While the information was helpful to my understanding, I was not able to resolve my problem using it.

I'm inclined to think Microsoft has so stuffed Windows that going to Unix is the only solution.