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

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

    Make sure you have backups of important databases and then try uninstall MySQL related stuff:

    apt-get remove --purge mysql\*
    

    Then install it again:

    apt-get install mysql-server mysql-client
    

    This worked for me and data was kept.

    If PHP MySQL shows errors you might have to reinstall PHP MySQL:

    apt-get install php5-fpm php5-mysql
    

提交回复
热议问题