This post outlines how to configure MariaDB or MySQL on Centos 7 in order to store a specific database outside of the typical /var/lib/mysql/DBNAME directory. Or in other words, how you can have each of your databases residing on a different drive (or a different folder on the same drive), while running only a single instance of MariaDB or MySQL.

First of all, open your MariaDB configuration file at /etc/my.cnf file and make sure that symlinks are turn on, it should look like this under [mysqld]:

Now, stop MySQLD service and move existing database from /var/lib/mysql/DatabaseName to a new location, that can be a drive or folder. Make sure you’re moving the directory of the database. Double check that directory /var/lib/mysql/DatabaseName no longer exist in the file system.

As a next step, we’ll make a symbolic link, that will link /var/lib/mysql/DatabaseName to new location of the directory (wherever you’ve copied it in the previous step).

This can be done by running following command:

Now when all is done, start your MariaDB or MySQL and you should see your database even that it resides on a different drive (or is located in a completely different folder).

Troubleshooting:

If you run into problems, experiencing errors when trying to access your database, such as “Can’t find file: … (errno: 13)”, it’ll most likely due to selinux blocking MySQL/MariaDB. Run following line to fix the issue:

 

 

 

Recently I came across the following error when developing against Acrobat DC libraries:

Unhandled Exception: System.Runtime.InteropServices.COMException: The procedure number is out of range. (Exception from HRESULT: 0x800706D1) at Acrobat.CAcroAVDoc.Open(String szFullPath, String szTempTitle) at *.Program.ConvertToPDF(String inputPath, String outputPath) at *.Program.Main(String[] args) and this article describes the simplest way to fix the problem. Read More →