Mysql 无法建立连接,因为目标机器主动拒绝它 [英] Mysql No connection could be made because the target machine actively refused it
问题描述
我知道已经有很多人问过这个了,但这些人大多忘记了被防火墙阻止的密码,我没有这种情况.
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 .
我正在使用 php 进行开发,我需要连接到远程数据库,让我的所有团队都可以处理它.
I am developing with php , and I need to connect to remote database to let all my team work on it .
localhost 一切正常,但是当我尝试切换时,它给了我这个错误
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.
这是我想要连接到 .nf.biz 数据库的代码:
and this is my code where I want to connect to .nf.biz database :
$db=mysqli_connect($host,$user,$password,$db_name,3306);
推荐答案
这可能晚了,但对于未来的访问者来说,
Well this might be late but for future visitors,
我当时发现 biz.nf 拒绝从外部来源连接到它的数据库,这意味着只有 biz.nf 可以访问他们的数据库,但您会被拒绝.
I found out back then that biz.nf refuses any connections to it's DB from outside source which means that only the web-apps hosted on biz.nf have the access to their DB other than that you will get rejected.
这篇关于Mysql 无法建立连接,因为目标机器主动拒绝它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!