MariaDB refusing to start after moving data directory on Fedora 29

0

Today I wanted to move my MariaDB data directory from the default directory on my main drive with Fedora installed to a secdonary hard drive mounted at /home/neboula/mnt/storage, so I began searching and found this article (I'm on Fedora Workstation 29 rather than CentOS 7, however).

Aside from that my configuration files were structured a bit differently (instead of having all configuration in my.cnf, it was split into various files in the directory my.cnf.d). Instead of putting everything in my.cnf as the article suggested, I changed the configuration in /etc/my.cnf.d/client.cnf and /etc/my.cnf/.d/mariadb respectively.

After doing this, and attempting to start MariaDB again, I was greeted with an error saying that the job for mariadb.service failed. I then had a look at systemctl status mariadb, which said Database MariaDB is not initialized, but the directory /home/neboula/mnt/storage/mariadb/mysql is not empty, so initialization cannot be done., and Make sure the /home/neboula/mnt/storage/mariadb/mysql is empty before running mysql-prepare-db-dir..

I've tried disabling SELinux without any luck, and also removing everything in said directory, which did not help either (I still have the database data backed up however).

Any suggestions on how to go about this? I want the data directory to reside on my secondary hard drive.

Newbyte

Posted 2019-03-18T19:03:20.857

Reputation: 111

Answers

0

I'm not entirely certain what the issue was, but mounting the external hard drive at /mnt/storage rather than /home/<username>/mnt/storage seems to have done the trick in my case.

Newbyte

Posted 2019-03-18T19:03:20.857

Reputation: 111