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

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

    I tried the following steps:

    1. Log in as super user or use sudo
    2. Open /etc/mysql/my.cnf using gedit
    3. Find bind-address, and change its value to the database server host machine's IP address. For me, it was localhost or 127.0.0.1
    4. Save and close the file.
    5. Come back to terminal and execute sudo service mysql start

    And it worked for me.

提交回复
热议问题