I know a lot of people have asked this question, but most of these people have forgotten their passwords that are blocked by firewalls, and I have not encountered this situation.
I am developing in php and need to connect to a remote database for my team to use together.
Everything is fine on localhost, but when I try to switch, I get the following error:
The connection cannot be established because the target machine actively refused the connection.
Here is the code I want to connect to the .nf.biz database:
$db=mysqli_connect($host,$user,$password,$db_name,3306);
Your MySQL server only accepts *nix sockets (/var/run/mysqld/mysqld.sock if you use Ubuntu) or local connections only.
You need to edit your my.cnf file (located at /etc/mysql/my.cnf in Ubuntu) and make the following changes:
bind-address = 0.0.0.0
and comment out the following:
#skip-networking
Finally restart MySQL.
Please note that if your MySQL server is accessible from the public internet, connections from anyone will be accepted!
Although it may be late, but for future visitors,
I discovered then thatbiz.nfrefuses any connections from external sources, meaning only those hosted onbiz.nfOnly web applications on the Internet can access their database, otherwise you will be denied.