I've got `PDOException: SQLSTATE[HY000] [2002] No such file or directory` when using drush I installed Drush for the first time (so it may be a configuration error) and I'm trying to update to the latest core version of Drupal.

Drush is giving me this error - I'm on an OSX box.

dev5:clientnamedirectory my.name$ drush pm-update projects drupal-7.25
&lt;h1&gt;Additional uncaught exception thrown while handling exception.&lt;/h1&gt;

&lt;h2&gt;Original&lt;/h2&gt;&lt;p&gt;PDOException: SQLSTATE[HY000] [2002] No such file or directory in drupal_get_installed_schema_version() (line 155 of /Users/my.name/Sites/proface/includes/install.inc).&lt;/p&gt;

&lt;h2&gt;Additional&lt;/h2&gt;

&lt;p&gt;PDOException: SQLSTATE[HY000] [2002] No such file or directory in system_list() (line 165 of /Users/my.name/Sites/clientnamedirectory/includes/module.inc).&lt;/p&gt;&lt;hr /&gt;

Drush command terminated abnormally due to an unrecoverable error.
This was how I solved it on macOS:

sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock


Source: Working with Drush on Mamp.