Connecting Wordpress to Database using Unix Domain Socket Do this inside your wp-config.php. It must be the absolute path to the socket. define('DB_HOST', 'localhost:' . __DIR__ . '/.mysql/mysql.sock');