Answer the question
In order to leave comments, you need to log in
(Errcode: 2) Why doesn't mysql start automatically after server reboot?
For Bitrix it was necessary to update mysql. It has been updated accordingly!
After starting through the command in the SSH console, I entered
systemctl start mysql
Jun 26 11:24:20 server mysqld[3174]: 2019-06-26 11:24:20 47780976727808 [ERROR] mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' ( Errcode: 2 "No such file or directory")
Jun 26 11:24:20 server systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Jun 26 11:24:21 server systemd [1]: Unit mariadb.service entered failed state.server.
Jun 26 11:24:21 server systemd[1]: mariadb.service failed.
chown mysql /var/run/mysqld
chmod 755 /var/run/mysqld
systemctl start mysql
Answer the question
In order to leave comments, you need to log in
Wang that /var/run is mounted in /tmp. This is true?
If yes, then it is logical that the /var/run/mysqld directory disappears after a reboot (/tmp is cleared every time, after all).
Then there are two ways:
1) Don't mount /var/run in /tmp (it's not a fact that nothing will break if the distro is configured this way by default);
2) In the mysql config, change the paths in the socket and pid-file variable:
socket=/var/lib/mysql/run/mysqld.sock
pid-file=/var/lib/mysql/run/mysqld.pid
For autoloading, you need to run it once:
Probably, you have already done this. And the problem is that someone dropped chmod / chown during the update
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question