Solved Mysql don't start anymore

You mean /var/run/mysqld because I don't have a /var/mysqld either.
yeah /var/run/mysqld - edited my post :)

But it was not only the /run/mysqld directory, there was also a symlink required from a non existing run/mysqld/mysqld.sock to /var/lib/mysql/mysql.sock (without the d) for it to start working. I didn't know how to add that automatically after a reboot.
Strange, just make sure you don't have a my.cnf somewhere that is overriding the pid file and socket that MySQL is looking for as MySQL can look at various paths to read them https://dev.mysql.com/doc/refman/8.0/en/option-files.html. Or if you need to add something on reboot, you can leverage old /etc/rc.local method or a systemd service file with ExecStart pointing to a shell script and Type=oneshot and RemainAfterExit=yes Service parameters. Then place everything you need done on server reboot into the shell script defined by ExecStart and run systemctl enable on that systemd service file/name :)
 
that is overriding the pid file and socket that MySQL is looking for
No I had the /var/lib/mysql/mysql.sock in there under the mysqld section which was also to be seen in the running string from mysql in the log, and socket=/usr/local/mysql/data/mysql.sock under the client section which is put there by default.
Also removing the /var/lib/mysql/mysql.sock and restarting or rebooting did not change anything either.
Reinstalling the second time and leaving out the mysqld line to mysql.sock did not help either.

I have only 1 single my.cnf not even a my.cnf.d directory (as on Centos and Alma). As said, I didn't change anyhting, just re-installed for the 3rd time and bang... suddenly working, used the same my.cnf too.

So yes it's strange indeed. I said it was spooky. :)

Thank you for pointing to the other options and the shell scripts. But if possible I try to use everything as default as possible, just to prevent issues.
And it still doesn't explain the other odd things which were happening before and solved suddenly was automatically fixed.

I'm under the impression that there is or might be some disk writing issue or something. Reinstalling mariadb is new disk writing. Going back and forth to DA 1.651 and back to 1.652 (fixed spf issue) is new disk writing. Restoring backups, deleting backups and restoring again (several times, fixed the dns issue) is also disk writing.
So to me this is the only thing which can explain all these odd things happening together without me changing anything myself.
I don't know if I can check the filesystem on a VPS somehow, without having to unmount stuff. Got customers on there now.
 
Back
Top