I have searched for a couple of hours now, and still am unable to find this.
I get 2 errors, if I use the database host as 'localhost'
, I get this error:
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
and if I change the database host to '127.0.0.1'
I get this error:
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
Things I have tried:
database.php
filelocalhost
to 127.0.0.1
and back.phpmyadmin
Any ideas how to fix this?
I figured it out, add this after the 'host' => '127.0.0.1'
:
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock'
So the connection would look like this:
'mysql' => array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
'database' => 'dbname',
'username' => 'josh',
'password' => 'pass',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
)