'Debian 10 MariaDB 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'

Good evening Community,

I am in despair because I cannot install MariaDB on Debian10. There are similar Stackoverflow questions but none of them helped to solve my problem.

What I've tried:

$ sudo apt update
$ sudo apt install mariadb-server

So far no errors.

$ sudo mysql_secure_installation

Leads to:

Enter current password for root (enter for none): ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
systemmd errors

Searching for the file called "mysqld.sock" doesn't deliver results.

$ cd /etc/init.d/
$ mysqld_safe
$ sudo find / -type s | grep mysqld.sock

Doesn't deliver any results. It appears that no mysqld.sock file has been created.

Stackoverflow: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Can anybody please help me with this problem?

Thanks,

milli727




Solution 1:[1]

systemctl stop mysql
systemctl stop mariadb
chkconfig --del mysql
systemctl disable mysql
systemctl disable mariadb
systemctl enable mariadb.service
systemctl start mariadb.service

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 4b0