Jump to content

SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/


brosjr

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.