Cara Switch MySQL ke MariaDB di cPanel


  Selamat malam bro, pembahasan kali ini akan membahas tentang cara switch MYSQL ke MariaDB di cPanel server centos 6. Meski belum secara resmi didukung oleh team cPanel, namun kita bisa mencoba mencicipi MariaDB pada server cPanel kita. Saat ini proses switch hanya bisa dilakukan dari MySQL 5.5 ke MariaDB 5.5, jadi bagi yang sudah upgrade ke MySQL 5.6 maka proses switch tidak bisa dilakukan dan kalaupun penasaran silakan dicoba dengan resiko ditanggung sendiri 🙂 Catatan tutorial ini dilakukan pada Centos 6 64 bit, WHM/cPanel 11.46 dan MySQL 5.5 Step By Step nya :

1. Backup data MySQl

cp -Rf /var/lib/mysql /var/lib/mysql-old
mv /etc/my.cnf /etc/my.cnf-old

2. Disable autoupdate MySQl oleh cPanel

/usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled
/usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled
/usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled

3. Hapus/Unlinstall RPM’s MySQL

/usr/local/cpanel/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55

outputnya kurang lebih seperti dibawah ini:

[20141120.072605] The following RPMs are unneeded on your system and should be uninstalled:
[20141120.072605] MySQL55-client-5.5.40-1.cp1136
[20141120.072605] MySQL55-devel-5.5.40-1.cp1136
[20141120.072605] MySQL55-server-5.5.40-1.cp1136
[20141120.072605] MySQL55-shared-5.5.40-1.cp1136
[20141120.072605] MySQL55-test-5.5.40-1.cp1136
[20141120.072605] compat-MySQL50-shared-5.0.96-4.cp1136
[20141120.072605] compat-MySQL51-shared-5.1.73-4.cp1136
[20141120.072606] Removing 0 broken rpms:
[20141120.072606] rpm: no packages given for erase
[20141120.072606] No new RPMS needed for install
[20141120.072607] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client compat-MySQL51-shared compat-MySQL50-shared MySQL55-shared MySQL55-devel

4. Buat repo untuk MariaDB

nano /etc/yum.repos.d/MariaDB.repo

Masukan Code di bawah ini :

# MariaDB 5.5 CentOS repository list - created 2014-11-19 14:04 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=1

5. Install MariaDB

yum install MariaDB-server MariaDB-client MariaDB-devel
/etc/init.d/mysql start
mysql_upgrade
/etc/init.d/mysql restart

6. Rebuid Easyapache

usr/local/cpanel/scripts/easyapache --build

Apabila ingin kembali switch ke MySQL silakan jalankan perintah dibawah ini :

/scripts/update_local_rpm_versions --edit target_settings.MySQL55 installed
/scripts/check_cpanel_rpms --fix

Semoga bermanfaat bro.

Sumber

Fahmi

We’re still Pioneers, We Barely Begun. Our Greatest Accomplishments cannot be behind us, cause our destiny lies above us.

Leave a Reply