Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2/20/24, 12:07 PM Document 1319877.

1
Copyright (c) 2024, Oracle. All rights reserved. Oracle Confidential.

Complete Upgrade Process for your Existing MySQL Server to Newer Versions (Doc ID 1319877.1)

In this Document

Goal
Solution
References

APPLIES TO:

MySQL Server - Version 5.1 and later


Information in this document applies to any platform.

GOAL

How to upgrade MySQL to a newer version.

SOLUTION

In order to avoid downtime and possible issues with the application after upgrading, it is recommended that you test your application using the new MySQL Server
version on a suitable test server before you upgrade your production environment.

Before you begin, consult the changelogs from your current running version for each minor and major versions, through to the latest version. Apply your knowledge of
your schema and dataset to the changelog to determine whether any incompatible changes have been implemented or will affect upgrading to the new version instance.
MySQL Release Notes

MySQL 5.1
MySQL 5.5
MySQL 5.6
MySQL 5.7
MySQL 8.0

Upgrade Checker Utility to find incompatibilities between the different versions of MySQL

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=19hl3gox20_119&id=1319877.1 1/4
2/20/24, 12:07 PM Document 1319877.1

Only available for upgrades within MySQL 8.0.x or from 5.7 to 8.0.

Doc ID 2748938.1: How to Perform a Compatibility Check in a MySQL Server Upgrade Scenario?

The upgrade process is very much the same no matter which version you intend to run after upgrading. The process is simply defined as:

1. Always take a backup of your database! This includes the schema, the data and the routines (functions, triggers etc) that are needed for the database to
function. Safety is always the best policy so if there is some problem during the upgrade process, it is easy to restore to the previous version again.
2. Fix any issues detected by the util.checkForServerUpgrade().
3. Add the option innodb_fast_shutdown=0 to your settings before the upgrade, for a proper and complete shutdown.
4. Only upgrades between consecutive major versions are supported and guaranteed to work. This means upgrading from 4.1 to 5.7 should take the sequence 4.1 -
> 5.0 -> 5.1 -> 5.5 -> 5.6 -> 5.7 -> 8.0 to upgrade. Although skipping versions should work, it is not guaranteed. Even if you do skip versions, be sure to run
the mysql_upgrade tool for each version to upgrade the MySQL Server system tables. That step must not be skipped.
5. Always upgrade to the latest version in the Generally Available (GA) release unless you have been advised not to do so due to incompatible issues, which would
be rare.
6. Read the change history details in the manual (8.0,5.7,5.6,5.5,5.1,5.0) and what possible incompatible changes have been made (8.0,5.7,5.6,5.5,5.1,5.0) and if
you will require to modify your application to suit. Part of the changes may be in the naming of the options, so please check to see if they need to be updated or
have depreciated.
7. Run the upgrade as required. This could be done as tarball, packages (RPM, PKG etc) or executable .msi file.
Further information for these processes are mention in the Next Steps method below.
8. a) Prior to 8.0.16 version:
After the upgrade is done, make sure you run the 'mysql_upgrade' program to get all the table versions and system tables updated and ready to run.
The mysql_upgrade command should be run on an upgraded replica server before starting the replication again.

You should always execute mysql_upgrade after an upgrade even if it is between patch releases of the same version (for example from 5.7.15 to 5.7.16). If
there is nothing to do (the most likely scenario), mysql_upgrade will complete quickly.

b) 8.0.16 version and later:


After the upgrade is done, the start up process will actually perform the upgrade of the system tables. The mysql_upgrade command is no longer needed as part
of the upgrade process.

Because the upgrade is done on the first start after upgrading, this can take a little longer than the previous versions.

9. Remember to consider the upgrade of the connectors and third-party libraries when you upgrade your server. Not only do the newer connectors offer more
features and bug fixes, but it could be that the old connector may be incompatible with the new server software. Please check the manuals and/or websites for
third-party upgrade processes to follow.

One thing to watch out for in the 5.5 upgrade is that you remove any InnoDB Plugin options from your my.cnf file if the InnoDB Plugin was used in the 5.1 release. The
5.5 version uses the InnoDB Plugin by default so the extra options are not required in this case and can cause conflict if left enabled.

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=19hl3gox20_119&id=1319877.1 2/4
2/20/24, 12:07 PM Document 1319877.1

MySQL recommends that for any upgrade to a newer version that a mysqldump is performed, the MySQL Server software is upgraded, and then the data restored to
avoid potential issues.
MEB should not be considered unless it is within patch versions e.g. 5.6.24 -> 5.6.25 etc. as MEB does not support upgrading/downgrading across versions.
As of MySQL 8.0 series, only the version of MySQL Enterprise Backup with same patch level is supported. Hence it is not possible to restore on the upgraded version.
See <Document 1392194.1> for more details.

When upgrading to 8.0, there is now a shell script that is able to check the configuration and determine if there will be any issues. This is call the upgrade checker
and is part of the 8.0 release only.

Next Steps: Further upgrade information can be found based on the version you downloaded: 8.0,5.7,5.6, 5.5, 5.1, 5.0.

REFERENCES
https://dev.mysql.com/doc/mysql-enterprise-backup/3.12/en/restore-upgrade.html
https://dev.mysql.com/doc/refman/5.6/en/backup-methods.html
NOTE:1300654.1 - How to Download or Patch MySQL Server 8.0, 5.7, 5.6, 5.5, 5.1 or 5.0; Standard Edition, Enterprise Edition; Advanced, Pro, Classic
https://dev.mysql.com/doc/refman/5.6/en/connectors-apis.html
NOTE:1991640.1 - How to Upgrade MySQL Server Using RPMs
NOTE:2187981.1 - How To Upgrade A Source-Replica Replication System?
https://dev.mysql.com/doc/refman/5.5/en/news-5-5-x.html
https://dev.mysql.com/doc/refman/5.0/en/news-5-0-x.html
NOTE:2518973.1 - First Restart of MySQL Server After Upgrading to 8.0.16 or Later Takes a Long Time
https://dev.mysql.com/doc/refman/5.0/en/upgrading-from-previous-series.html
https://dev.mysql.com/doc/refman/5.6/en/checking-table-incompatibilities.html
https://dev.mysql.com/doc/refman/4.1/en/upgrading-from-previous-series.html
NOTE:2073526.1 - How To Upgrade MySQL Server Using MySQL Installer?
https://dev.mysql.com/doc/refman/5.6/en/mysql-upgrade.html
https://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previous-series.html
https://dev.mysql.com/downloads/connector/
https://dev.mysql.com/doc/refman/5.6/en/news-5-6-x.html
https://dev.mysql.com/doc/refman/5.1/en/news-5-1-x.html
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/index.html
https://dev.mysql.com/doc/refman/5.6/en/mysql-nutshell.html
https://dev.mysql.com/doc/refman/5.1/en/upgrading-from-previous-series.html
https://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html
NOTE:1581862.1 - MySQL Upgrade from 5.5 to 5.6 Using MEB Backup Fails; Assertion Failure in Thread in File pars0pars.cc Line 865; Failing Assertion: sym_node-
>table != NULL
NOTE:1598594.1 - MySQL Upgrade and Downgrade TAR Generic releases
https://dev.mysql.com/doc/mysql-shell/en/mysql-shell-utilities-upgrade.html
NOTE:2748938.1 - How to Perform a Compatibility Check in a MySQL Server Upgrade Scenario?
NOTE:2501127.1 - Executing mysql_upgrade in MySQL 8.0.16+ Fails: "The mysql_upgrade client is now deprecated. The actions executed by the upgrade client are now
done by the server."
NOTE:1392194.1 - Which Versions of MySQL Server are Compatible with MySQL Enterprise Backup (MEB)?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=19hl3gox20_119&id=1319877.1 3/4
2/20/24, 12:07 PM Document 1319877.1
Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=19hl3gox20_119&id=1319877.1 4/4

You might also like