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

前端 未结 30 1619
南方客
南方客 2020-11-22 11:30

I am getting the following error when I try to connect to mysql:

Can\'t connect to local MySQL server through socket \'/var/lib/mysql/mysql.sock\' (2)<

30条回答
  •  故里飘歌
    2020-11-22 11:51

    Check if your mysqld service is running or not, if not run, start the service.

    If your problem isn't solved, look for /etc/my.cnf and modify as following, where you see a line starting with socket. Take a backup of that file before doing this update.

    socket=/var/lib/mysql/mysql.sock  
    

    Change to

    socket=/opt/lampp/var/mysql/mysql.sock -u root
    

提交回复
热议问题