Welcome Guest, Not a member yet? Register   Sign In
Problem Connecting to MySQL, CentOS
#1

I'm having problems getting CodeIgniter to connect to a remote DB.

My base system is as follows:
CentOS 7 running on AWS
Apache, PHP and MySQL Client Installed
Installed php-mysql
CodeIgniter 3.0.0 installed and working with pages not using DB.

Remote database:
Amazon RDS running MySQL (separate machine).

I can connect to the DB from the base system using MySQL command line.
When I try connecting to the DB through a CodeIgniter connector, I receive the error below.
I'm using the same parameters in database.php in CI as in MySQL command line (checked a few times)

Any ideas? Thanks.

Andy

Severity: Warning
Message: mysqli::real_connect(): (HY000/2003): Can't connect to MySQL server on 'hostname' (13)
Filename: mysqli/mysqli_driver.php
Line Number: 135
Backtrace:
File: /var/www/html/application/controllers/Messages.php
Line: 72
Function: database
File: /var/www/html/index.php
Line: 292
Function: require_once

$db['default'] = array(
'dsn' => '',
'hostname' => 'hostname',
'username' => 'user',
'password' => 'pwd',
'database' => '',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Reply


Messages In This Thread
Problem Connecting to MySQL, CentOS - by ad11 - 06-27-2015, 10:39 AM
RE: Problem Connecting to MySQL, CentOS - by ad11 - 06-30-2015, 11:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB