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.
| Comment | File | Size | Author |
|---|---|---|---|
| Screen shot 2010-10-08 at 11.31.21 AM.png | 248.46 KB | dvb |
Comments
Comment #1
damien tournoud commentedMarking as a duplicate of #793200: Document all database settings in default.settings.php.
Comment #2
eyeofyou@kldp.org commentedIt works on OSX. Thanks for your tip.