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

前端 未结 30 1594
离开以前
离开以前 2020-11-22 02:25

I installed LAMP on Ubuntu 12.04 LTS (Precise Pangolin) and then set root password on phpMyAdmin. I forgot the password and now I am unable to login. When I try to chan

30条回答
  •  深忆病人
    2020-11-22 03:20

    Somehow the MySQL server process did not create the socket, or the client is looking for the socket in the wrong place.

    My first suggestion would be to check if the MySQL server is running. Second suggestion might be, is the MySQL server running on another host? If so, add the -h flag to your MySQL client in the terminal.

    If MySQL is indeed running, and running locally, check your my.cnf file. There should be a line like

    socket = /var/run/mysqld/mysqld.sock
    

    See if that matches the socket location that you mentioned in your post.

    From experience, I would say the most likely scenario is your MySQL server either is not running at all or is not running on the same host as where you run your MySQL client from the terminal.

提交回复
热议问题