S
S
Skyrunner ™ @Skyrunner2020-05-22 10:00:45
MySQL
Skyrunner ™ @Skyrunner, 2020-05-22 10:00:45

Can't connect to local MySQL server through socket?

Good day. I ran into a problem that I can’t solve in my favor in any way - a Zabbix system has been configured and installed on a virtual machine under Debian 10, which has been successfully functioning for two months. I didn't contact the system for two weeks, the day before yesterday I tried to access the Web interface and found the following error "Database error.Error connecting to database: Permission denied". Got into Debian, and there it turned out that the Mariadb service does not want to start and issues the following "Job for mariadb.service failed because a fatal signal was delivered to the control process". Zabbix log file says "Z3001. Connection to database 'zabbix' failed:[2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'. Given file, mysqld.sock , empty and initially it was not in this folder, as well as the folder itself. It was created according to manuals from the network to solve this problem, but it did not help. Port 3306 is not busy, checked with lsof -Pn -iTCP:3306. Please help me to solve the problem, otherwise the network has the same solutions that do not help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
paran0id, 2020-05-22
@paran0id

The socket does not need to be created manually. It must be created by the mysql (or mariadb) service, its path may differ in different distributions, look in the mysql (or mariadb) config for this path. Also, the port may not be 3306, you need to look in the same place in the config. And in general, you need to make sure that the mysql (or mariadb) service is running.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question