I\'m trying to connect to my MySQL DB with the Terminal on my Apple (With PHP).
Yesterday it worked fine, and now I suddenly get the error in the title.
The
Since your might use MAMP, either change your Port to the default 3306 or use 127.0.0.1 in the database.php
$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
);
Or with the default settings:
$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
);