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

前端 未结 30 1605
离开以前
离开以前 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:17

    If you're using Amazon EC2, and you're having this problem on the instance, then you only need to do:

    sudo yum install mysql-server
    sudo service mysqld restart
    

    Amazon EC2 doesn't have a server installed (only the client is installed), so in case of that you need to install that on your instance, and after that try

     mysql -u root -p
    

    to check if that worked.

提交回复
热议问题