Full error message: Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in DatabaseConnection->__construct() (line 289 of /Users/dumisizwe/Sites/drupal7/includes/database/database.inc).

Secondary error message: Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory.

Specs:
- Vanilla install of drupal-7.0-beta1 from git://github.com/drupal/drupal.git
- Mac OSX 10.6.4
- Database server: MySQL 5.1.44 via socket
- Client: MySQL Client Version 5.1.8
- PHP 5.3.2
- Apache/2.2.14 (Unix)

Fix: based on http://prattski.com/2010/08/05/magento-install-mysql-error-sqlstatehy000...
---
1. Open up php.ini (mine was in /private/etc/)
2. locate this line: pdo_mysql.default_socket=/var/mysql/mysql.sock
3. Change the line to: pdo_mysql.default_socket=/tmp/mysql.sock
4. Restart apache

Hope this helps.

CommentFileSizeAuthor
Screen shot 2010-10-08 at 11.31.21 AM.png248.46 KBdvb

Comments

damien tournoud’s picture

Status: Active » Closed (duplicate)
eyeofyou@kldp.org’s picture

Issue summary: View changes

It works on OSX. Thanks for your tip.