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

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

    MariaDB, a community developed fork of MySQL, has become the default implementation of MySQL in many distributions.

    So first you should start,

    $ sudo systemctl start mariadb
    

    If this fails rather try,

    $ sudo systemctl start mysqld
    

    Then to start mysql,

    $ mysql -u root -p
    

    As of today, in Fedora the package is named mariadb And in Ubuntu it is called mariadb-server.

    So you may have to install it if its not already installed in your system.

提交回复
热议问题