# mysql error 2002



## kr651129 (Nov 30, 2012)

I'm getting a mysql error 2002 and I've found online that I need to just point at the correct location of mysql.sock.  After doing a locate I can't find it anywhere.  Does anyone have any insight on this?


```
Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in /usr/local/www/apache22/data/includes/database/database.inc on line 304
Skip to main content
Error
The website encountered an unexpected error. Please try again later.
Error message

    Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in DatabaseConnection->__construct() (line 304 of /usr/local/www/apache22/data/includes/database/database.inc).
    Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in DatabaseConnection->__construct() (line 304 of /usr/local/www/apache22/data/includes/database/database.inc).
    Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in DatabaseConnection->__construct() (line 304 of /usr/local/www/apache22/data/includes/database/database.inc).
    Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in DatabaseConnection->__construct() (line 304 of /usr/local/www/apache22/data/includes/database/database.inc).
    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/apache22/data/includes/database/database.inc:304) in drupal_send_headers() (line 1212 of /usr/local/www/apache22/data/includes/bootstrap.inc).
    PDOException: SQLSTATE[HY000] [2002] No such file or directory in lock_may_be_available() (line 167 of /usr/local/www/apache22/data/includes/lock.inc).
    Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in DatabaseConnection->__construct() (line 304 of /usr/local/www/apache22/data/includes/database/database.inc).
```


----------



## kr651129 (Nov 30, 2012)

Solved


```
/usr/local/etc/rc.d/mysql-server restart
```

Recreated mysql.sock


----------

