How to Upgrade MySQL on a cPanel ServerPosted on Updated on
It’s not always easy to manage software and upgrades on complex systems like a Virtual Private Server or VPS. As a general rule, it’s good to have the latest versions of all packages so that security breaches can be patched for example. But you have to make sure that it doesn’t break something on your system. Some packages are more important than others, and when it comes to frameworks that are the backbone of a server, few things can compare to the database system. MySQL is one of the most commonly used database products in the industry and it comes installed with WHM. Most of the time you will want to upgrade it to the latest versions.
In fact, WHM does this automatically for you for point releases. These refer to updates to the version number in the third decimal place. They rarely involve critical structural changes and so are a safe upgrade. Major version releases however are a different matter. For example, when MySQL moved from version 5.4 to 5.5, to change the way it implements its InnoDB functionality. In addition, it also changed the my.cnf file. Such changes have the potential to break existing software that depends on them. As a result, you will have to decide for yourself when and how to manage the upgrade of MySQL. Do you want to schedule it during downtime? Are you waiting for a software patch from another vendor first?
Either way, WHM makes it easy to upgrade MySQL installations – all you need is the required permissions and a bit of time. Here’s how you go about it.
Performing the Upgrade
When you log into WHM, search for the “Software” section on the left-hand side. Underneath that, you can see the “MySQL Upgrade” list item as shown here:
This will open up a new window showing you several important details about your current installation, and what you can upgrade to. In the screenshot below for example, you can see that my current database version – 5.5 – can be upgraded to 5.6. The screen lists all the important features in the latest version giving you an overview that should help you decide if upgrading the database is worthwhile or not.
So let’s select the new version and go to the next screen. Here you have to tick off two checkboxes indicating that you fully understand the risks of upgrading your database. In the first place, the system warns you that you should take a backup of the existing database system. Second, it instructs you that there is no way to downgrade a MySQL database framework from a higher version two a lower one.
If both of these look alright to you, check them off and click “Continue”. Here you get to decide whether or not you want a fully automated upgrade process or only a partial one. Central to this decision is the rebuilding of Apache and PHP. Not all MySQL upgrades require them to be rebuilt. In my test example, the system recommends a partial upgrade without an Apache/PHP rebuild. I still have the option to do so at the end of the upgrade process, but it’s not automatic. If your system recommends the same, go ahead and perform the partially automated upgrade.
Once done, you just have to sit back and wait for the upgrade process to complete. This can take quite a while – at least 15 min. for me. All the while, you can check the output in the box below to see the progress.
Once that’s done, you can see in the screenshot below that you can also choose to rebuild Apache and PHP using the EasyApache module that we talked about earlier.
If not, sit back and enjoy the new upgraded MySQL version!