drupal-7.24 + xmapp MySQL 在Mac 10.9出现(with SQLSTATE[HY000] [2002] No such file or directory)

Drupal按照出现了with SQLSTATE[HY000] [2002] No such file or directory的错误,如下图片:

drupal-7.24 + xmapp MySQL 在Mac 10.9出现(with SQLSTATE[HY000] [2002] No such file or directory)_第1张图片


下面是官方给出bug修复

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


1、我这里需要补充下,如果是新系统或者刚玩php的同志,在Mac的系统中php.ini 文件不存在,

2、需要在/private/etc/目录下cp  php.ini.default php.ini ,然后再做修改下,

3、但是如果使用的xampp mysql作为数据库,那么就不需要使用官方的step2,直接写下面方式就可以了。

pdo_mysql.default_socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock


你可能感兴趣的:(drupal-7.24 + xmapp MySQL 在Mac 10.9出现(with SQLSTATE[HY000] [2002] No such file or directory))