After upgrading from
drush 6.5.0 to
8.0.1-dev through brew, the drush terminal command returns the popular
'PDOException: SQLSTATE[HY000] ' error.
The only way to make it work is to add the unix_socket line to my Drupal
settings.php files for all my projects:
$databases = array ( 'default' => array ( 'default' => array ( 'database' => 'site', 'username' => 'user', 'password' => 'pass', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', ), ), );
Even if I use
/var/mysql/mysql.sock, it will work, because I have a symlink up:
lrwxr-xr-x 1 root wheel 39B Mar 11 2015 /var/mysql/mysql.sock -> /Applications/MAMP/tmp/mysql/mysql.sock
But that is exactly the thing I don't understand. And I would like to configure it at one point so I don't have to edit all the current and upcoming project's
So my question is: Where does drush look for the path of the mysql socket (on MAMP)?
If it's through the
php.ini, it should be correct too (/Applications/MAMP/bin/php/php5.6.10/conf/php.ini):
mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock
.bash_profile contains no alias or export related to this issue because it worked fine with my previous drush installation.