Step 1: Backup existing MySQL data
Make sure to save all existing data just in case there are any issues.
cp -Rf /var/lib/mysql /var/lib/mysql-old
mv /etc/my.cnf /etc/my.cnf-old
## Also please take sql file of the existing databases, so that we can avoid the data lose
Step 2: Disable the targets so cPanel no longer handles MySQL updates #ONLY FOR cPanel 11.36+
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
Step 3: Remove existing MySQL RPM’s so theres a clean slate for MariaDB
/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55
[20130623.211100]
[20130623.211100] The following RPMs are unneeded on your system and should be uninstalled:
[20130623.211100] MySQL55-client.5.5.31-1.cp1136
[20130623.211100] MySQL55-devel.5.5.31-1.cp1136
[20130623.211100] MySQL55-server.5.5.31-1.cp1136
[20130623.211100] MySQL55-shared.5.5.31-1.cp1136
[20130623.211100] MySQL55-test.5.5.31-1.cp1136
0
[20130623.211100] Removing 0 broken rpms:
[20130623.211100] rpm: no packages given for erase
[20130623.211100] No new RPMS needed for install
[20130623.211100] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client MySQL55-shared MySQL55-devel
Step 4: Create a yum repository for MariaDB
access https://downloads.mariadb.org/mariadb/repositories and select the DISTRO and place the repo content to /etc/yum.repos.d/MariaDB.repo
EX (In my cause):
#vi /etc/yum.repos.d/MariaDB.repo
# MariaDB 5.5 CentOS repository list - created 2013-06-23 21:13 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=
Step 5: install MariaDB using the following command
yum install MariaDB-server MariaDB-client MariaDB-devel
##If you are having any dependency problem, please remove php from the /etc/yum.conf file and then run yum command again. Please add it back to yum conf once the package is installed.
/etc/init.d/mysql start
mysql_upgrade
/etc/init.d/mysql restart
Final Step: Rebuild easyapache/php to ensure modules are intact/working
/scripts/easyapache --build
No comments:
Post a Comment