Skip to main content

Upgrading from MySQL 8.4 (or Earlier) to MySQL 9.7

Important

  • Downgrading from MySQL 9.x is not supported.
  • Create a full backup before starting.
  • If you are using a version older than 8.4, you must first upgrade to MySQL 8.4 LTS.

Step 1 – Create a Backup​

Create a full backup using mysqldump or mysqlpump.


Step 2 – Upgrade to MySQL 8.4 LTS (if required)​

Download MySQL 8.4 LTS:

https://dev.mysql.com/downloads/mysql/8.4.html

Oracle upgrade guide for older versions:

https://dev.mysql.com/doc/refman/8.4/en/upgrading.html

Upgrade using your preferred method (installer, package manager or ZIP archive).

Important

Before starting MySQL 8.4 for the first time, temporarily enable support for the legacy authentication plugin by adding the following entry to your MySQL configuration file (my.ini or my.cnf):

mysql_native_password=ON

This setting allows users that still authenticate with mysql_native_password to continue connecting while you migrate all accounts to caching_sha2_password.

After completing the user migration and before upgrading to MySQL 9.7, remove this option from the configuration file. MySQL 9.x completely removes support for mysql_native_password and will not start if this option is configured.


Step 3 – Run the MySQL Upgrade Checker​

Install MySQL Shell​

Ubuntu / Debian

sudo apt update
sudo apt install mysql-shell

Windows / macOS

Download:

https://dev.mysql.com/downloads/shell/

Run compatibility check​

mysqlsh
\connect username@host:port
\js
util.checkForServerUpgrade('username@host:port', {"targetVersion":"9.7.0"})

Resolve all reported issues before continuing.


Step 4 – Replace mysql_native_password​

MySQL 9.x completely removes the mysql_native_password authentication plugin.

Check existing users:

SELECT user, host, plugin FROM mysql.user;

For every account using mysql_native_password, execute:

ALTER USER 'username'@'host'
IDENTIFIED WITH caching_sha2_password
BY 'YourStrongPassword';

This should also be done for application users and the root account if applicable.


Step 5 – Update MySQL Configuration​

Open my.ini (Windows) or my.cnf (Linux).

Remove obsolete authentication settings​

Remove:

default_authentication_plugin=mysql_native_password

or

mysql_native_password=ON

MySQL 9.x will not start if these settings are present.

Replace deprecated UTF-8 configuration​

Older MySQL versions used utf8 as an alias for utf8mb3.

Replace every occurrence of:

utf8

with

utf8mb4

This applies to server configuration and any manually configured character set settings.


Step 6 – Update JDBC Configuration​

Payara​

For every JDBC Connection Pool, add:

PropertyValue
allowPublicKeyRetrievaltrue

This setting is required when using caching_sha2_password without SSL/TLS (useSSL=false). It allows the JDBC driver to retrieve the server RSA public key required for password encryption.

priint-bpm​

Open application.yml.

Append the following parameter to the datasource URL:

&allowPublicKeyRetrieval=true

Step 7 – Install MySQL 9.7​

Download MySQL 9.7.2:

https://dev.mysql.com/downloads/mysql/9.7.html

Upgrade using your preferred installation method (installer, package manager or ZIP archive).

For example, on Windows you may extract the ZIP archive into your MySQL installation directory.


Step 8 – Validate the Upgrade​

  • Start MySQL.
  • Verify all databases are available.
  • Verify all applications can connect.
  • Check the MySQL error log.
  • Run a few application tests.

If any application cannot connect after switching to caching_sha2_password, verify that:

  • the JDBC driver supports MySQL 9.x,
  • allowPublicKeyRetrieval=true is configured,
  • SSL settings are correct.

The upgrade is now complete.