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

Discussion in 'General Server' started by newtonentropy, Mar 19, 2014.

  1. newtonentropy

    newtonentropy New Member

    Mar 19, 2014
    Likes Received:
    I'm a bit new to the linux world and as with any new person mistakes may happen. I was setting up a project on my localhost and had an issue with the an incorrect password for the database. In an attempt to fix the problem I used a password from the staging environment and placed in phpmyadmin at the root level. This locked me out. Obviously not the right solution.

    I researched many different links on how to resolved this issue and tried some things that did not work.

    1. I tried directing mysql to the right spot as suggested in a forum. this is what I used:
    ln -s /tmp/mysl.sock/var/mysql //to direct mysql to the right spot (mis-typed name)
    ln -s /tmp/mysql.sock/var/mysql //typed name correctly

    After doing this action I got a different PDO error:

    "PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2) inlock_may_be_available() (line 167of/Applications/MAMP/htdocs/bramptonbrick/includes/lock.inc)."

    2. I tried doing this action to fix the new error:
    sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf

    As to not create any more problems than I already have, I decided to try and get some help.

    Can anyone assist me on how to get the default settings back or how to reverse the actions I made?

    Any help would be much appreciated.


Share This Page