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

前端 未结 30 1608
南方客
南方客 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:56

    Ensure that your mysql service is running

    service mysqld start
    

    Then, try the one of the following following:

    (if you have not set password for mysql)

    mysql -u root
    

    if you have set password already

    mysql -u root -p
    

提交回复
热议问题