I am getting Connection Refused in the ADODB Connection but mysqli works

installation

(Pikeshawn) #1

I cloned my server from one machine in a network to another machine in another network. The machines are identical. I had openemr running in the old network but it seems to have problems in the new network. I can get into the mysql db using mysqli but I cannot get there using the adodb connection. When I use the ADODB connection I get - connection refused.

If I check the IP address in the ADODB connection that is being used as the host for the mysql server, I get the IP address of the old server and not the new one.

Does anyone know where this IP address could be coming from? Is there a way to change it so that it will pull the correct IP address?

Even with that, I hard-coded the IP address in the sqlinc.php file so that the ADODB connection would use the right one but this still failed.

I tried reinstalling the application using the setup file but it did not trigger - even though the sites/default/sqlconfig.php file has the config variable set to 0.

I rolled all of my changes back the point of the initial install but that did not seem to affect it.

I don’t know how to force a new setup. I am wondering if that would help.

Any suggestions would be very helpful.

this works

$dbname='db';
$password='pass';
$port='1234';
echo "<br>$server<br>$user<br>$password<br>$port<br>$dbname<br>";
if (mysqli_connect($server, $user, $password, $dbname, $port)) {
   echo 'I connected';
} else {
        echo 'not connected';
}



this does not
$database->PConnect($host, $login, $pass, $dbase);

The variables in both scenarios have the same values

(Brady Miller) #2

hi @pikeshawn ,

Sorry for the delayed reply on this. Note that when the server and mysql are on separate servers, mysql will check to ensure the access is granted from the specific server, which can throw things off sometimes. For your mysql user in phpmyadmin, does the user have something like <username>@<hostname>?

Also, what OpenEMR version is this?

-brady