G
G
gohellp2021-09-12 00:31:43
MySQL
gohellp, 2021-09-12 00:31:43

How to revive mysql?

Mysql crashed on vds after updating packages. Reinstalling and clearing configs didn't help. I already tried the answers to such a problem - either I dug badly and did not find it, or I didn’t do it right.

At the moment this is the error:

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


When I try to run it, it throws this:
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

oH2vPNA.png

Thanks in advance for your help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-09-12
@shambler81

The simplest option is that it really doesn't exist
1 The solution is:
1. Create a mysqld folder
sudo mkdir /var/run/mysqld
2. Create a mysqld.sock file
sudo mkfifo /var/run/mysqld/mysqld.sock
3. Set the mysql owner to the mysqld folder
sudo chown -R mysql /var/run/mysqld
Here's something else
This error occurs due to multiple installations of mysql. Run the command:
ps -A|grep mysql
Kill the process with:
sudo pkill mysql
and then run the command:
ps -A|grep mysqld
Also kill this process by running:
sudo pkill mysqld
Now you are fully configured, just run the following commands:
service mysql restart
mysql -u root -p
There is a very good working mysql again
and there are more neglected cases

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question