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

后端 未结 30 2660
日久生厌
日久生厌 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条回答
  •  面向向阳花
    2020-11-22 11:22

    Changing the host to 127.0.0.1 worked for me.

    Edit the file in /etc/mysql/my.cnf and add the below mentioned line to the section: client

    [client]
    port  = 3306
    host  = 127.0.0.1
    socket  = /var/lib/mysql/mysql.sock
    

    After you are done with it. Execute the following command.

    sudo service mysql start
    

提交回复
热议问题