I have this error when iI try to connect to external DB:
Severity: Warning --> mysqli::real_connect(): (HY000/2002): Connection refused system/database/drivers/mysqli/mysqli_driver.php 202
I am sure credentials are Ok and if I use this code to check if I can connect:
PHP Code:
$servername = "servername.com";
$username = "username";
$password = "password";
$database = "database";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
I always got "
Connected successfully"
This is my configuration:
Quote:$db['mydb'] = array(
'dsn' => '',
'hostname' => 'servername.com',
'username' => 'username',
'password' => 'password',
'database' => 'database',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => TRUE, // or FALSE doesn't make difference
'db_debug' => '',
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Any advise?