Find the path to your MySQL Unix socket:
netstat -ln | grep "unix.*mysql"
The path should look similar to this:
/var/lib/mysql/mysql.sock
Edit the DB_HOST directive in your wp-config.php and add your socket path after localhost:
define('DB_HOST', 'localhost:/var/lib/mysql/mysql.sock');