When I try to run mysql in my debian based virtual machine I get the next output:
user@host:~$ mysql
ERROR 2002 (HY000):Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'(2)
I also tried:
user@host:~$ sudo mysql
ERROR 2002 (HY000):Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'(2)
Also:
root@host:~$ mysql
ERROR 2002 (HY000):Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'(2)
I tried looking for the next configuration files in order to determine the socket:
/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf
None of these showed any socket configuration. MySQL is installed by default in this distribution.
user@host:~$ mysql --version
mysql Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2