Last night the MySQL server instance in my dbclone jail stopped working. This is the jail into which copies of all my databases eventually go for test restores and backups.
This morning I tried started it:
[dan@dbclone:~] $ sudo service mysql-server start /usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
My initial search suggested removing /var/db/mysql (this will lose all your data). Since this was a testing server, I tried it. No success.
I tried permissions:
service mysql-server stop # make sure it's not running rm -rf /var/db/mysql/* chown mysql:mysql /var/db/mysql # In case the permissions are wrong service mysql-server start
I tried moving away my configuration file:
sudo cp -i /usr/local/etc/mysql/my.cnf /usr/local/etc/mysql/my.cnf.precmd.fails sudo cp -i /usr/local/etc/mysql/my.cnf.sample /usr/local/etc/mysql/my.cnf
What did work
This loses your configuration and your data.
sudo pkg delete mysql57-server sudo rm -rf /usr/local/etc/mysql sudo rm -rf /var/db/mysql sudo pkg install mysql57-server sudo service mysql-server start
What a bunch of wasted time.