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

后端 未结 30 1794
再見小時候
再見小時候 2020-11-30 23:15

I\'m getting this error

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

even though

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 23:57

    Firstly, please confirm mysql-server is installed. I have the same error when mysql-server is installed but corrupted somehow. I do the trick by uninstall mysql completely and reinstall it.

    sudo apt-get remove --purge mysql*
    sudo apt-get autoremove
    sudo apt-get autoclean
    sudo apt-get install mysql-server mysql-client
    

提交回复
热议问题