Viewed   161 times

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 where I want to connect to .nf.biz database :

$db=mysqli_connect($host,$user,$password,$db_name,3306);

 Answers

3

Well this might be late but for future visitors,

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.

Saturday, November 19, 2022
 
a_guijt
 
3

I changed the ip address specified in the homestead.yaml from localhost to 192.168.10.10. Then I ran homestead provision and that seemed to fix the problem. The host machine cannot resolve localhost or 127.0.0.1 because that is already mapped to itself.

Thursday, December 8, 2022
 
4
  1. Go to C:wampbinmysqlmysql[your-version]data
  2. Copy and save "ib_logfile0" and "ib_logfile1" anywhere else.
  3. delete "ib_logfile0" and ib_logfile1

Did the trick for me. hope it works for you too.

Its working fine. But we will have to stop apache and mysql, We need to quit xampp and then delete file. when deleted successfully. now start xampp it will work properly..

Friday, September 2, 2022
 
1

Don't use this kind of code. It's highly inefficient. Use mysqli_fetch_assoc() instead:

while($row = mysqli_fetch_assoc($result)) {
   $id = $row['ID'];
   $name = $row['name']; 
   etc..
}

One SINGLE database operation, rather than the 3+ you're trying to do.

Sunday, December 4, 2022
3

In general, you do not need to use either of these functions at all. All resources that the server has allocated to you will be released automatically when the PHP script finishes executing, so in the most common scenario there is nothing you should be concerned about.

Sometimes you might want to use mysqli_close, for example inside a long-running script that has done what it needs to do with the database and does not wish to tie up server resources for the remainder of its execution.

You should never have need to use mysqli_kill at all: what this function does is instruct the server to destroy a worker thread. This is getting into "mucking around where you are not invited" territory, which might be useful in some situations but certainly never under normal operation.

Friday, October 7, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share