Operating System: Mac OS X 5.2
Using MAMP: Mac Apache MySQL PHP
PHP5
Drupal: 6.2

Test installation is working fine. Drush is installed and enabled in Drupal including the modules PM, wget, Toolbox.

The error message "E: Could not locate the Drupal installation directory. Aborting." appears when executing drush in an arbitrary directory.

When executing drush in the Drupal top level directory, I get the following output:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Site off-line | Drupal



Site off-line

The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.


If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider's database server is running. For more help, see the handbook, or contact your hosting provider.

The mysqli error was: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2).


Comments

prodosh’s picture

Status: Active » Closed (fixed)

Drush looks for the MYSQL socket at /var/mysql/mysql.sock (where can one customize this?).
When using MAMP, the socket is at /Applications/MAMP/tmp/mysql/mysql.sock

As a workaround, execute the following on a Mac OS X command line:

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

Drush now works fine.

Markus Sandy’s picture

I had to create the /var/mysql folder before creating the symbolic link.

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

Thanks for the tip!