How to Replace MySQL with Percona – WHM

How to Replace MySQL with Percona – WHM


This document describes how to replace the cPanel-provided and cPanel-managed MySQL® installation with your own installation of Percona.


This document describes an unsupported workaround that we do not guarantee will work in the future.

  • After you perform these steps on a server, the system administrator must manage and maintain the server’s database software.
  • We recommend that only experienced system administrators attempt to perform these steps.
  • We are not responsible for any data loss that any attempts to perform these steps cause.

Replace MySQL with Percona

To replace the cPanel-provided MySQL installation with Percona, perform the following steps:


The i nnodb_log_file_size file’s default setting in Percona version 5.5 and MySQL version 5.6.8 and earlier differs from MySQL version 5.6.8 and later. If your server runs MySQL version 5.6.8 and later, we strongly recommend that you perform the following actions before you replace MySQL with Percona:

  • Change the i nnodb_log_file_size file’s size to match the /var/lib/mysql/ib_logfile0 file’s size.
  • Change the i nnodb_log_file_size file’s size to match the /var/lib/mysql/ib_logfile1 file’s size.

To execute these changes, perform the following steps:

  1. Open the /etc/my.cnf file with a text editor.
  2. Edit the innodb_log_file_size line’s setting to match the /var/lib/mysql/ib_logfile0 and the /var/lib/mysql/ib_logfile1 files’ sizes. For example:
  1. Run the following commands to back up your existing MySQL data:
    cp -afv /var/lib/mysql /var/lib/mysql-old
    mv -v /etc/my.cnf /etc/my.cnf-old
  2. Run the following commands to disable the MySQL RPM targets. cPanel & WHM will no longer handle MySQL updates, and the rpm.versions system will mark the associated MySQL RPMs as uninstalled.
    /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 
    /usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.MySQL56 uninstalled
    /usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.MariaDB100 uninstalled
    /usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.MariaDB101 uninstalled
  3. Run the following command to remove the existing MySQL RPMs from your server.
    /usr/local/cpanel/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56,MariaDB100,MariaDB101

    You will see a message that resembles the following output:

    [20130218.235953]   The following RPMs are unneeded on your system and should be uninstalled:
    [20130218.235953]   MySQL51-devel.5.1.68-1.cp1136
    [20130218.235953]   MySQL51-test.5.1.68-1.cp1136
    [20130218.235953]   MySQL51-shared.5.1.68-1.cp1136
    [20130218.235953]   MySQL51-client.5.1.68-1.cp1136
    [20130218.235953]   MySQL51-server.5.1.68-1.cp1136
    [20130218.235953]   Removing 0 broken rpms: 
    [20130218.235953]   rpm: no packages given for erase
    [20130218.235953]   No new RPMS needed for install
    [20130218.235953]   Uninstalling unneeded rpms: MySQL51-devel MySQL51-test MySQL51-shared MySQL51-client MySQL51-server
    [20130219.000004]   Shutting down MySQL........ SUCCESS!
  4. Run the following command to create a yum repository for Percona:
    vi /etc/yum.repos.d/Percona.repo
  5. Enter the following contents for the /etc/yum.repos.d/Percona.repo file:
    name = CentOS $releasever - Percona
    enabled = 1
    gpgkey =
    gpgcheck = 1
  6. Use a text editor to open the /etc/yum.conf file and remove php* and mysql* from the exclude line. The exclude line in your /etc/yum.conf file may appear similar to the following example:
    exclude=bind-chroot courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* ruby* spamassassin* squirrelmail*
  7. Run the following commands to install Percona and restart the appropriate services:
    yum install Percona-Server-client-55 Percona-Server-server-55 Percona-Server-devel-55
  8. Run the following command to create a symlink:
    ln -sv /usr/lib64/ /usr/lib64/


  9. Run the following command to rebuild EasyApache’s PHP to ensure that all PHP modules remain intact:
    /usr/local/cpanel/scripts/easyapache --build

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.