error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' — Missing /var/run/mysqld/mysqld.sock

后端 未结 30 2491
日久生厌
日久生厌 2020-11-22 10:49

My problem started off with me not being able to log in as root any more on my mysql install. I was attempting to run mysql without passwords turned on... but whenever I

30条回答
  •  旧时难觅i
    2020-11-22 11:40

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

    in /etc/my.cnf add this lines:

    [client]
    socket=/var/lib/mysql/mysql.sock <= this path should be also same as is[mysqld]
    

    And restart the service with: service mysql restart

    this worked for me

提交回复
热议问题