Setting up drupal 7 with MariaDB on Fedora

1. Edit file /etc/my.cnf.d/mariadb-server.cnf and add these 3 lines to the [mysqld] section:


This will enable usage of Multi-byte (in particular – 4-byte) UTF-8 support in Drupal 7.

2. mysqli: If you have problems with mysqli/mysql change the mysqli to mysql (or vice versa – whatever works for you) in /sites/default/settings.php.

Alternatively – there is the mysqli settings in php.ini so you can control this setting globally from there. This file is usually in a directory like :/etc/php/7.2/cli. The command (+ its output) to confirm active php.ini location is:

$ php -i | grep php.ini
Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini

3. If you are getting errors when importing a MySQL DB export (done via phpMyAdmin) into MariaDB, redo the export and select “Quick – display only the minimal options”. This may produce a large file, so you may either gzip it manually; or – when doing the import to MariaDB – save the exported file to the server upload directory which is by default /var/lib/phpMyAdmin/upload/ and have phpMyAdmin get it from there when importing.

    -= OR =-

Use the command line tools to save and restore the DB.

Dump with mysqldump:
$ mysqldump -u {username} -p {database name} > database_backup_name.sql

Then restore it with
mysql [-u {username} -p] [{db_name}] < backup-file.sql

Again – you might want to gzip the .sql file…