I have a magento site that works just fine in production. However, when I create an identical clone of the site in a 'dev' subdomain on the same hosting site (for maintenance work) I get the dreaded: "SQLSTATE[HY000]  No such file or directory" error.
My investigation has revealed that indicates that Zend PDO is attempting to connect to a local database using a Unix socket but none exists. This makes sense since MySQL isn't running on localhost, but on a separate server.
What doesn't make sense is why Magento / Zend are attempting to connect to MySQL via unix socket when there is a remote hostname specified in my local.xml !
And, since it will be asked...
- yes, the credentials and host are correct and connectivity is fine
- several other webapps in the same subdomain work just fine
- this is a connection error, not an authentication error
- yes, I cleared the cache