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

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

    The solution is way easier.

    1. First, you have to locate(in Terminal with "sudo find / -type s") where your mysql.sock file is located. In my case it was in /opt/lampp/var/mysql/mysql.sock
    2. Fire up Terminal and issue sudo Nautilus
      This starts your Files manager with super user privileges
    3. From Nautilus navigate to where your mysql.sock file is located
    4. Right click on the file and select Make Link
    5. Rename the Link File to mysqld.sock then Right click on the file and Cut it
    6. Go to /var/run and create a folder called mysqld and enter it
    7. Now right click and Paste the Link File
    8. Voila! You will now have a mysqld.sock file at /var/run/mysqld/mysqld.sock :)

提交回复
热议问题