I know there are many people already asked this , but this people mostly forgot password of blocked by firewall which i have none of this situations .
i am developing with php , and i need to connect to remote database to let all my team work on it .
localhost was just going fine , but when i tried to switch it gave me this error
No connection could be made because the target machine actively refused it.
and this is my code
i want to connect to .nf.biz database
$db=mysqli_connect($host,$user,$password,$db_name,3306);
thanks erverone
I fixed this by setting the bind-address in my.cnf to the server's public IP address:
Your MySQL server is only accepting connections on *nix socket (/var/run/mysqld/mysqld.sock if you're running Ubuntu) or for localhost only.
You have to edit your my.cnf (on Ubuntu again is located in /etc/mysql/my.cnf) and change the following:
bind-address = 0.0.0.0
And comment out the following
#skip-networking
Finally restart MySQL.
Be careful with that, if your MySQL machine is accessible from public Internet will be accepting connections from everybody!