How do I upgrade MySQL/MariaDB on my server?
Although in-place upgrades are generally safe, you should always perform a full database backup before you begin the upgrade process. For more details on methods in which to generate backups, see the following article.
If you are looking to upgrade to MySQL 8.0 there are some additional concerns that you should be aware of. Please visit the following article before proceeding.
The cPanel nightly updates will automatically upgrade your MySQL/MariaDB installation to newer point releases (the third digit in the version string) because these upgrades involve little risk to your users’ data. Upgrades to new major releases (the first two digits in the version string) are more involved because there is a substantial risk of data loss.
The WHM interface "Home »SQL Services »MySQL/MariaDB Upgrade" is provided to allow users to easily manage these upgrades. This will be where you want to perform the upgrade task in most cases(see CloudLinux section below).
Before proceeding, please note that downgrades to previous versions are unsupported. After you upgrade your system to a newer version, it may be impossible to switch back.
- To perform an upgrade, you will need to first select the circle next to the major version you wish to install under the section labeled "Select a Version". For example, the following image shows a user that has selected an upgrade to MySQL 8.0.
- After selecting the desired version you will click the button labeled "Continue" at the bottom of the page to begin the process.
On the following page, you will see warnings that will need to be reviewed and marked as approved if you wish to proceed. These will outline the potential risks of upgrading to the selected major version and should be understood before proceeding. Once ready to proceed, you will again press the Continue button. Please ensure that the tasks outlined in the section 'Before Upgrading' have been addressed before pressing this button.
If it is available for the version you have selected, please ensure you use the upgrade checker before proceeding. This will do a dry run of the upgrade in order to check for known conflicts that you should address before proceeding. To do so, press the button labeled "Run Checker".
This time you will be presented with a new screen containing the options to perform either an "Unattended Upgrade" or an "Interactive Upgrade". Select the one you wish to proceed with and then click "Continue".
The Unattended will use your last saved default settings when rebuilding Apache, PHP, and Ruby Gems. The Interactive will allow you to control each of these steps as you go. This choice depends on whether you need to make any changes or just wish for the full process to complete automatically. If you need to make any changes, this is the last step in which you can "Go Back".
Please ensure you are ready to perform the upgrade before pressing the Continue button.
- You have now begun the upgrade process. Please ensure that you monitor the interface for any errors or failures during this task. If the upgrade completes successfully, you will see the following reported at the end of the task.
In the event you cannot actively watch this process, the logs can later be reviewed in the directory '/var/cpanel/logs/mysql_upgrade.$date-variable'. Where the value date and variable will be replaced with the current date(ie, year month day) and a randomized series of numbers.
For additional information regarding the usage of this feature, please visit the following documentation.
The primary exception to this would be if running the CloudLinux provided MySQL Governor. If this is the case, you will see a warning like the following in this interface instead of your upgrade options.
If you see the above warning, please visit the following CloudLinux documentation for upgrading MySQL/MariaDB instead.