Step 1: Backup existing MySQL data
cp -Rf /var/lib/mysql /var/lib/mysql-old
mv /etc/my.cnf /etc/my.cnf-old
Step 2: Disable the targets so cPanel no longer handles MySQL updates
/scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled
/scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled
/scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled
Step 3: Remove existing MySQL RPM’s so there's a clean slate for MariaDB
/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55
Step 4: Create a yum repository for MariaDB
vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/[version]/[osdistro]/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Replace [version] with the equivalent of the version of MySQL you are running. Replace [osdistro] with the operating system you are utilizing.
Step 5: Remove php from the /etc/yum.conf file then run the following commands
yum install MariaDB-server MariaDB-client MariaDB-devel
/etc/init.d/mysql start
mysql_upgrade
/etc/init.d/mysql restart
Step 5: Add php back to the /etc/yum.conf file to ensure future php updates don’t get clobbered Final Step: Rebuild easyapache/php to ensure modules are intact/working
/usr/local/cpanel/scripts/easyapache --build