Connection to server failed? NOT permission denied?
Find out where mysql.sock is located.
edit this in your php.ini to match
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
Restart Apache or IIS or whatever you're using.