MariaDB on Fedora 27 Fails to Start from RocksDB Inclusion
-
If you are using MariaDB (which can show up as MySQL) on Fedora 27 you may have gotten a nasty surprise with a new database called #mysql50#.rocksdb appearing in your database list today and your database no longer able to start. You might find an update notice...
When you go to start MariaDB, you might get this error message:
Apr 06 20:38:07 vny-lnx-lamp1 mysql-check-upgrade[1400]: The datadir located at /var/lib/mysql needs to be upgraded using 'mysql_upgrade' tool. This can be done using Apr 06 20:38:07 vny-lnx-lamp1 mysql-check-upgrade[1400]: 1. Back-up your data before with 'mysql_upgrade' Apr 06 20:38:07 vny-lnx-lamp1 mysql-check-upgrade[1400]: 2. Start the database daemon using 'service mariadb start' Apr 06 20:38:07 vny-lnx-lamp1 mysql-check-upgrade[1400]: 3. Run 'mysql_upgrade' with a database user that has sufficient privileges Apr 06 20:38:07 vny-lnx-lamp1 mysql-check-upgrade[1400]: Read more about 'mysql_upgrade' usage at: Apr 06 20:38:07 vny-lnx-lamp1 mysql-check-upgrade[1400]: https://mariadb.com/kb/en/mariadb/documentation/sql-commands/table-commands/mysql_upgrade/ Apr 06 20:38:07 vny-lnx-lamp1 systemd[1]: Started MariaDB 10.2 database server.
You might try to take a backup only to find:
mysqldump: Got error: 1102: "Incorrect database name '#mysql50#.rocksdb'" when selecting the database
And of course your mysql_upgrade won't run for the same errors. What to do?
So what is wrong? MariaDB just rolled out a new update that adds RocksDB support, but doesn't work. This has been a known issue for months but just hit the production repos. Whoops.
Luckily the fix is pretty simple... just move the RocksDB files out of the MariaDB data directory and restart. Assuming that you have kept the default database directory of /var/lib/mysql you can just do this...
systemctl stop mariadb mv /var/lib/mysql/.rocksdb /tmp/ systemctl start mariadb mysql_upgrade systemctl restart mariadb
That's it, you should be all set.
-
@scottalanmiller So as my systems update over the next 24 hours they are all going to break?
Or does it not hit until the service attempts to restart (say from a reboot or manual restart)?
-
@jaredbusch said in MariaDB on Fedora 27 Fails to Start from RocksDB Inclusion:
@scottalanmiller So as my systems update over the next 24 hours they are all going to break?
Hit us on update, no restart involved