Welcome Guest, Not a member yet? Register   Sign In
database failover not working
#1

I am testing failover database configuration and seems to be ignored. The config follows:

PHP Code:
public $default = [
'DSN'      => '',
'hostname' => 'localhost',
'username' => '****',
'password' => '****',
'database' => '****',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug'  => (ENVIRONMENT !== 'production'),
'cacheOn'  => false,
'cacheDir' => '',
'charset'  => 'utf8',
'DBCollat' => 'utf8_unicode_ci',
'swapPre'  => '',
'encrypt'  => true,
'compress' => false,
'strictOn' => false,
'failover' => [[
  'DSN'      => '',
  'hostname' => 'localhost',
  'username' => '****',
  'password' => '****',
  'database' => '****',
  'DBDriver' => 'MySQLi',
  'DBPrefix' => '',
  'pConnect' => false,
  'DBDebug'  => (ENVIRONMENT !== 'production'),
  'cacheOn'  => false,
  'cacheDir' => '',
  'charset'  => 'utf8',
  'DBCollat' => 'utf8_unicode_ci',
  'swapPre'  => '',
  'encrypt'  => true,
  'compress' => false,
  'strictOn' => false,
  'port'    => 3306,
  ]],'port'    => 3307// <-- intentionally wrong to trigger failover]; 




An attempt to use any model with this configuration simply throws a mysqli_sql_exception. Why is the failover configuration not used as fallback?
Reply
#2

Can't reproduce. CI v4.1.5
Reply




Theme © iAndrew 2016 - Forum software by © MyBB