Connecting to remote database |
I have been with trying to connect to a remote database all day. I have given remote access to a user and I can connect from my terminal but my application can't connect to the remote database. Please I need any form of help. I am new to codeigniter and I really need to work on this project
Zakk, I connect to AWS RDS. I do this by setting the connection params in the database.php in the config dir.
$db['default'] = array( 'dsn' => '', 'hostname' => 'database-2.ast-1.rds.amazonaws.com', 'username' => 'adn', 'password' => '1b3o', 'database' => 'subator', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE ); You also need to use this in your code: $this->load->database();
proof that an old dog can learn new tricks
READ:
How Do I Enable Remote Access To MySQL Database Server? What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |