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

后端 未结 30 2488
日久生厌
日久生厌 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:24

    Why getting this error

    I received new updates of mysql libraries so i updated my Kubuntu OS after that getting these errors.


    Commands i tried and how i fixed it.

    MySql-server is running correctly but when i tried to connect its giving

    Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
    

    I checked /var/run/mysqld/mysqld.sock'. this directory. My files did not existed.

    I also tried these commands to connect but did not worked for me.

     mysql -h 127.0.0.1 -P 3306 -u root -p
    
     sudo service mysql start
    

    After wasting round about 2 hours i found the solution

    sudo apt-get clean
    sudo apt-get update
    sudo apt-get upgrade -f
    

    After that everything fixed for me.

提交回复
热议问题