N
N
NikSIk312020-08-07 16:17:37
linux
NikSIk31, 2020-08-07 16:17:37

Why does Mysql stop working?

Starting to work with VPS, I go through the lessons .. In general, I somehow set up a server and installed wordpress, laravel there on different domains. However, when installing one or the other, errors sometimes occur with the database. Yes, and I myself go to mysql -u username -psometimes I get this error

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

after a reboot it disappeared (but after it appeared ...), in the solutions for stackoverflows there were answers to create a folder with this socket, but they do not help. Another guide said that you need to install mysql-server (there is no file without it), but I just installed it.
And now I don't understand anything. On the one hand, they tell me that mysql is stable, but on the other hand, I see that it is not clear how I get these errors ..

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Mirilaczvili, 2020-08-07
@2ord

You need to make sure that the mysqld process is running and always running.
With the help of the Mysql plugin, the Munin monitoring program allows you to monitor the work.

C
CityCat4, 2020-08-07
@CityCat4

Let's start over. What distribution and what version?
Muscle error given means that the muscle is not running.

N
Nikita Pushkar, 2020-08-08
@NickPush

Since there is no exact error log, I can describe how I met such a problem a long time ago.
as that for a long time received a problem that the mysql demon went to bed. It turned out that when there are a lot of connections, the database opens a lot of sockets, and then everything ...
after a long study of the highload site, I realized that there was a problem in the database config. In general, it turned out to recreate the error - just hold F5 on the site that pulls the base. and after 30 seconds I got an error ..
I decided that I installed percona - it seems to be already configured MariaDB. and it works stably and faster.
still it is possible to tune - there is such script on a pearl. very cool
https://github.com/major/MySQLTuner-perl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question