Impossible to find socket of mysql ( MariaDb installed)
I have the following error, but when I try to find the socket file there is in fact nothing
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")I have MariaDb on a ubuntu 18.04 How can I add this socket? I used to work with mysql but I am a bit lost with MariaDb as they replicated config everywhere
EDIT 1
nothing related to mysql / mariadb here
/var/run/mysqld
nicolas@nicolas-UX530UX:/var/run$ ls /var/run/mysqld/mysqld.sock
ls: cannot access '/var/run/mysqld/mysqld.sock': No such file or directory
nicolas@nicolas-UX530UX:/var/run$ service mysql status
Unit mysql.service could not be found. 4 1 Answer
Solution 1:
Make sure that you have installed the mysql-server, not the mysql-client or something else. If you didn't install mysql-server, then the file would not exist. So install mysql-server.
Solution 2:
If the mysql-server is already installed and is running, then you need to check the config files.
The config files are located at:
/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf
In /etc/my.cnf, the socket file config may be /tmp/mysql.sock
and
in /etc/mysql/my.cnf the socket file config may be /var/run/mysqld/mysqld.sock.
So, remove or rename /etc/mysql/my.cnf, and let mysql use as /etc/my.cnf.