Migrating Redmine (or any Passenger app) from MySQL to MariaDB
I recently tried moving from MySQL to MariaDB, and was truly surprised with the results - everything works just fine, didn't even have to recreate users/databases. Well, everything except Redmine (and I would assume, and other Passenger app).
The thing to remember here is that gem extensions are compiled against the libraries you have on your system. In my case, to replace MySQL with MariaDB was a simple task of removing the MySQL packages, installing the MariaDB repo and packages, and replacing my old MySQL config ( which was removed by my package manager along with the MySQL packages ). Hence the libraries the gem expects are not there anymore.
Getting it all to work is a simple case of recompiling the gem with the new libraries -
$ gem install mysql2 -- --with-mysql-config=/usr/bin/mysql_config
In case you're using Ruby Enterprise Edition (which I am) you probably need to prepend you installation path (which I didn't, and was the cause of some hair pulling):
$ /opt/ree187/bin/gem install mysql2 -- --with-mysql-config=/usr/bin/mysql_config
Hope this helps someone