I’m using mariadb 15.1 on Ubuntu 22.04
I’m running a bunch of webapplications that require a mysql server. Each of the hosted apps is having on issue interacting with mariadb.
However, if I try to import, export or inspect a database using the commandline, I get this:
“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)”
/tmp/mysql.sock doesn’t exist on this system.
/tmp/mysql.sock
is the default socket location for non-packaged based systems.
Ubuntu/Debian defaults to /run/mysqld/mysqld.sock
.
If in doubt, look at the logs for the mariadb.service
with journalctl -n 40 -u mariadb.service
where it logs the location where the socket it created.
Perhaps you have /tmp/mysql.sock
in a configuration file under /etc/mysql
or elsewhere that is incorrect.