Mysql无法建立连接,因为目标计算机主动拒绝了它 [英] Mysql No connection could be made because the target machine actively refused it

查看:96
本文介绍了Mysql无法建立连接,因为目标计算机主动拒绝了它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道已经有很多人问过这个问题,但是这些人大多忘记了被防火墙阻止的密码,而我在这种情况下都没有.

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆