Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 514
fmc Avatar asked Nov 09 '22 22:11

fmc


1 Answers

use

    sudo service mysql stop
    sudo service mysql restart
like image 74
M.Davari Avatar answered Dec 06 '22 15:12

M.Davari