CodeIgniter Forums
Error Connection remote db mysql - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Error Connection remote db mysql (/showthread.php?tid=64412)



Error Connection remote db mysql - marco - 02-17-2016

Hi all,
I have a problem with db connection on my remote mysql server:

Fatal error: Call to a member function real_escape_string() on boolean in/xxx/system/database/drivers/mysqli/mysqli_driver.php on line 391

and

Message: mysqli::real_connect(): (HY000/2003): Can't connect to MySQL server on 'xx.xxx.xxx.xxx' (111)

Filename: mysqli/mysqli_driver.php
Line Number: 202

I try to access with same config parameter on my mysql client gui and i connected successfully.

My codeigniter versione is 3.0.4

Thank's
Marco.Italy


RE: Error Connection remote db mysql - kilishan - 02-17-2016

Try changing the hostname from 'localhost' to '127.0.0.1' and see if that makes a difference.


RE: Error Connection remote db mysql - marco - 02-18-2016

Hi,
I don't wont to connect on my localhost; my mysql server is on another server.
I try connect to server with for example HeidiSQL and work correctly. When i try to connect
with the same config with codeigniter fail.


RE: Error Connection remote db mysql - Avenirer - 02-19-2016

You must make sure that your other server accept remote connections and from what IP's.