Steps to replace MySQL with MariaDB in cpanel!
Its really important to switch the things time to time…it will help you to keep you on in today’s fast growing hosting world. Please sure to backup the existing MySQL data/database’s at your end before proceeding with replacement…its for safety purpose.
Steps to replace MySQL with MariaDB in cpanel:
cp -Rf /var/lib/mysql /var/lib/mysql-old
mv /etc/my.cnf /etc/my.cnf-old
Disable the targets so cPanel no longer handles MySQL updates
The following will mark the versions of MySQL we distribute as uninstalled so they are no longer maintained by cPanel/WHM
/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
Remove existing MySQL RPM’s so there’s a clean slate for MariaDB
The below command will uninstall the MySQL RPM’s!
/scripts/check_cpanel_rpms –fix –targets=MySQL50,MySQL51,MySQL55
Create a yum repository for MariaDB
place the following inside of it depending on the DISTRO (https://downloads.mariadb.org/mariadb/repositories/):
name = MariaDB
baseurl = http://yum.mariadb.org/5.5.29/centos6-amd64/
Remove php from the /etc/yum.conf file then run the following commands
yum install MariaDB-server MariaDB-client MariaDB-devel
Add php back to the /etc/yum.conf file to ensure future php updates don’t get clobbered
Rebuild easyapache/php to ensure modules are intact/working