Today I’m going to walk you through how I went about replacing MySQL with Percona. The load on one of my servers reached the point where replacing MySQL with Percona just made sense. The approach used here may seem redundant to some but this is the way I got things to work. We’ll need to upgrade MySQL to 5.5 so the database connector used by Plesk is updated as well, otherwise things might not work. If you haven’t heard about Percona I suggest you head on over to percona.com.

A little bit about Percona from their website

1 2 3 4 5 6 7 8 9 10 11 A free open source solution, Percona Server is a MySQL alternative which offers breakthrough performance, scalability, features, and instrumentation. Self-tuning algorithms and support for extremely high-performance hardware make it the clear choice for organizations that demand excellent performance and reliability from their MySQL database server. Features: - Queries will run faster and more consistently - You can consolidate servers on powerful hardware - Sharding is delayed or avoided entirely - You can save money on hosting fees and power - You can spend less time tuning and administering - You can achieve higher uptime - Troubleshooting does not require guesswork URL: www.percona.com

First things first, make sure Plesk is up to date, at the time of writing Plesk stood at 11.5.30 Add the Atomic repository to CentOS.

1 wget - q - O - http : //www.atomicorp.com/installers/atomic |sh

You should see this in the end

Next step is to update MySQL, this will in turn upgrade PHP as well. The server I am upgrading was running PHP 5.3 so an upgrade is welcome.

1 yum upgrade mysql

Next step is to upgrade all the database for MySQL 5.5

1 mysql_upgrade - uadmin - p ` < / etc / psa / . psa . shadow `

It’s now time you log into Plesk and make sure it’s working properly, to verify this add a new customer. If all goes well you should see a message similar to the one below. Note: test is the name of the customer for the sake of this example. Here starts the fun part, start by dumping all of the MySQL databases.

1 mysqldump - uadmin - p ` < / etc / psa / . psa . shadow ` -- all - databases | gzip > / root / mysql . all . dump . sql . gz

Below we’re going to remove MySQL.

1 2 3 4 5 service mysqld stop rpm - e -- nodeps ` rpm - q -- whatprovides mysql - server ` yum remove mysql mysql - server plesk - mysql

This makes sure you only remove MySQL and none of it’s dependencies.

Issue the following to add the Percona repo to your server.

1 yum install http : //www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm

Issuing the following at shell should tell you what’s available through Percona.

1 yum list percona - server*

To get Percona up and running you need three things

Percona-Server-Client-5.6

Percona-Server-Server-5.6

Percona-Server-Shared-5.6

Issue the following at shell to install the client server and shared library.

1 yum install Percona - Server - client - 56 Percona - Server - server - 56 Percona - Server - shared - 56

Start the Percona server.

1 service mysql start

woohoo!

Now check and see whether Plesk is playing nice with it. Again, create a new customer to see whether things run smoothly, if the customer is created then all is good.