fmc
fmc

Reputation: 490

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

I just formatted my drive and installed MariaDB on Linux Mint 17.

$ mysql --version
mysql  Ver 15.1 Distrib 10.1.1-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

I typed: mysql -u root -p gave it my passowrd and got this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

I did a search and found mysqld.sock was missing. I've read a lot of posts on this but nothing that's fixed this for me. How do I get mysqld.sock? Do I have to install some MySQL files to get it? If so, will this affect MariaDB?

Upvotes: 5

Views: 5146

Answers (1)

M.Davari
M.Davari

Reputation: 43

use

    sudo service mysql stop
    sudo service mysql restart

Upvotes: 1

Related Questions