MAMPを使用している可能性があるため、ポートをデフォルトの3306に変更するか、database.phpで127.0.0.1を使用します。
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',// leave it for port 3306
'username' => 'yourUserhere',
'password' => 'yourPassword',
'database' => 'yourDatabase',
'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
);
またはデフォルト設定で:
$db['default'] = array(
'dsn' => '',
'hostname' => '127.0.0.1:8889',// leave it for port 8889
'username' => 'yourUserhere',
'password' => 'yourPassword',
'database' => 'yourDatabase',
'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
);