How to replace MySQL with PerconaDB on a cPanel server

Percona Server is an enhanced drop-in replacement for MySQL.

Features of PerconaDB
>> Your queries will run faster and more consistently.
>> You will consolidate servers on powerful hardware.
>> You will delay sharding, or avoid it entirely.
>> You will save money on hosting fees and power.
>> You will spend less time tuning and administering.
>> You will achieve higher uptime.
>> You will troubleshoot without guesswork.

Some more,
>> Higher number of INFORMATION_SCHEMA Tables
>> Higher number of Global Performance and Status Counters
>> Per-Index Performance Counters
>> Per-User Performance Counters
>> Per-Client Performance Counters
>> High-Resolution Process List Timing
>> Fast Checksum Algorithm
>> Buffer Pool Pre-Load
>> Support for FlashCache
>> Import Tables From Different Servers

Steps to replace MySQL with MariaDB

1. To be secure with our current data, make sure to take a backup:

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

2. Disable the targets so that cPanel won’t handle 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

3. Remove all the MySQL RPMs from the server

# /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55

The above command will uninstall all the MySQL RPMs from the server.

4. Create Yum repository for PerconaDB

Create a file “PerconaDB.repo”.

# vi /etc/yum.repos.d/PerconaDB.repo

Add the following entries,

[percona]
name = CentOS $releasever - Percona
baseurl=http://repo.percona.com/centos/$releasever/os/$basearch/
enabled = 1
gpgkey = http://www.percona.com/redir/downloads/percona-release/RPM-GPG-KEY-percona
gpgcheck = 1

5. Remove php from “exclude” list in /etc/yum.conf

6. Install PerconaDB-sever, PerconaDB-client, PerconaDB-devel

# yum install Percona-Server-client-55 Percona-Server-server-55 Percona-Server-devel-55

7. Start MySQL

# /etc/init.d/mysql start

8. Then, run mysql_upgrade

# mysql_upgrade

9. Restart MySQL

# /etc/init.d/mysql restart

10. Add PHP back to the /etc/yum.conf file in “exclude” list

11. Recompile Apache with PHP

# /scripts/easyapache --build
/etc/init.d/mysql status
 SUCCESS! MySQL (Percona Server) running (9425)

That’s it 🙂 🙂

Related Links:
How to replace MySQL with MariaDB on a cPanel server
How to upgrade MySQL from 5.1 to 5.5 in a cPanel server – command line option

Arunlal Ashok

Linux Server Administrator. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

3 Responses

  1. Andy says:

    Ur forgetting a IMp step after

    /etc/init.d/mysql restart

    U have to run this
    ln -s /usr/lib64/libperconaserverclient.so /usr/lib64/libmysqlclient.so

    Or else u will get error in easyapache built

  1. February 9, 2014

    […] How to replace MySQL with PerconaDB on a cPanel server How to enable remote MySQL for an IP address on a cPanel server via CSF How to upgrade MySQL from […]

  2. February 11, 2014

    […] Click here for complete installation step for PerconaDB. 🙂 […]

Leave a Reply

Your email address will not be published. Required fields are marked *