Welcome Guest, Not a member yet? Register   Sign In
Codeigniter + remote Debian MySQL database
#1

[eluser]clustersblue[/eluser]
Hi,

Anyone tried before connecting CI to a remote MySQL database hosted from a Debian (whezzy) OS?

My web application is hosted from a Windows using apache web server and my MySQL database is hosted from a Debian OS.

To check my CI application is working I first tried connecting it to a MySQL database hosted by XAMPP from a Windows server and so far it works fine. However, when I tried to connect to a MySQL database in Debian with the same configuration I got this error.

Quote:A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: D:\xampp\htdocs\td\sys\database\DB_driver.php

Line Number: 124


And here is my database setup to Debian OS

Code:
$db['default']['hostname'] = 'debian_server_name';
$db['default']['username'] = 'test_director';
$db['default']['password'] = 'password';
$db['default']['database'] = 'lexautomation';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Windows MySQL server is my development database while Debian MySQL server is the production, the reason why I have this scenario.

Hoping for somebody help me address this issue.

Best Regards and Thanks!
#2

[eluser]Massaki[/eluser]
I think your linux server is blocking external connections.
You have to edit /etc/mysqk/my.cnf, and change 'bind-address = 127.0.0.1' to 'bind-address = 0.0.0.0'
Then access your mysql database and execute this command:
"GRANT ALL ON *.* TO 'root'@'192.168.0.X' IDENTIFIED BY 'your_password';"
( change user / client ip / password )




Theme © iAndrew 2016 - Forum software by © MyBB