brosjr Posted January 4, 2011 Share Posted January 4, 2011 Hi all, I'm experiencing a problem with the server I am storaging my PHP application. I developed it all based on PDO database access on Zend Studio 6 with 5.2.6 PHP version. The server is running 5.1.6 PHP, so I asked them to update to 5.2.6 because I'm getting the following error message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) They replied me telling me to use HOST instead SOCKET to access the database. I have searched for a solution and it all seens really confusing, because the queries without PDO return the correct results, but the ones with PDO shows the above message. Other solutions seens to be related to server configuration. A simple update of the server would not solve this, once it runs perfectly on my computer? I really need to rewrite all my application to get rid of all the PDOs? Thankx Danilo Jr. Quote Link to comment https://forums.phpfreaks.com/topic/223313-sqlstatehy000-2002-cant-connect-to-local-mysql-server-through-socket-var/ Share on other sites More sharing options...
trq Posted January 4, 2011 Share Posted January 4, 2011 Use the ip address of your database server instead of the hostname. eg; 127.0.0.1 instead of localhost. Quote Link to comment https://forums.phpfreaks.com/topic/223313-sqlstatehy000-2002-cant-connect-to-local-mysql-server-through-socket-var/#findComment-1154429 Share on other sites More sharing options...
brosjr Posted January 4, 2011 Author Share Posted January 4, 2011 I've already tried this and both returns the same error. uó! Quote Link to comment https://forums.phpfreaks.com/topic/223313-sqlstatehy000-2002-cant-connect-to-local-mysql-server-through-socket-var/#findComment-1154435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.