Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MySQL socket error 2002

  • 15-04-2016 10:16PM
    #1
    Closed Accounts Posts: 87 ✭✭


    Hi

    I am aware that this is a known error and I've searched everywhere but I cannot solve it.

    I installed MySQL by double clicking the .pkg file on my Mac. When I try mysql -u root -p I get this error:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)

    Any reason why? The mysql.sock file is located in /var/mysql but there's no text in the file. Where should it be? I've spent the whole day trying to fix this but the error still persists.

    In /etc is where my.cnf file is located and in it is this:

    [mysqld]
    datadir=/usr/local/var/mysql
    socket=/var/mysql/mysql.sock

    [mysql.server]
    user=mysql
    basedir=/usr/local/Cellar/mysql/5.6.10

    [client]
    socket=/var/mysql/mysql.sock

    I'm using OSX El Capitan. I just want to set up MySQL so I can use phpMyAdmin as a GUI.

    Any help is appreciated.


Comments

  • Registered Users, Registered Users 2 Posts: 3,500 ✭✭✭Drexel


    Is the MySQL server actually running? Have you started it?


  • Closed Accounts Posts: 87 ✭✭scuderia


    Drexel wrote: »
    Is the MySQL server actually running? Have you started it?

    Yes. When I go to Activity Monitor the process "mysqld" is there.


  • Registered Users, Registered Users 2 Posts: 3,500 ✭✭✭Drexel


    scuderia wrote: »
    Yes. When I go to Activity Monitor the process "mysqld" is there.

    Try restarting it and logging in again. Also you are passing -p but with no password

    Loads of people seeing the same error. Just google it and work through some of the suggestions. One of them will be the correct one


  • Closed Accounts Posts: 87 ✭✭scuderia


    Drexel wrote: »
    Try restarting it and logging in again. Also you are passing -p but with no password

    Loads of people seeing the same error. Just google it and work through some of the suggestions. One of them will be the correct one

    It prompts me for a password and when I enter it I get the error. I've looked everywhere, no idea what to do anymore. Have a post on Stack Overflow as well:

    http://stackoverflow.com/questions/36654411/mysql-cant-connect-to-local-mysql-server-error-2002


  • Registered Users, Registered Users 2 Posts: 3,500 ✭✭✭Drexel


    scuderia wrote: »
    It prompts me for a password and when I enter it I get the error. I've looked everywhere, no idea what to do anymore. Have a post on Stack Overflow as well:

    http://stackoverflow.com/questions/36654411/mysql-cant-connect-to-local-mysql-server-error-2002

    The guys on stack overflow should sort it for you. They are very good.

    One thing, have you set a root password? I think MySQL has no password set by default. Ha e you tried logging in without -p?


  • Advertisement
Advertisement