How to Upgrade MySQL 8.4 to MySQL 9.7 LTS
Plan a MySQL 8.4 to 9.7 LTS upgrade: confirm the supported path, run MySQL Shell Upgrade Checker, rehearse a restorable backup, and use the right package workflow.
On this page
MySQL 8.4 LTS can be upgraded directly to MySQL 9.7 LTS, the next LTS series. MySQL 8.0 must first be upgraded to MySQL 8.4; do not skip that LTS release. The supported upgrade methods include an in-place upgrade, logical dump and load, or replication. Confirm the official upgrade paths and MySQL release model before choosing a method.
An upgrade changes the server software and may change behavior. Test the exact procedure on a copy of the production instance, verify that a backup can be restored, and schedule production downtime only after application checks pass.
1. Record the source version and installation method
Connect to the server and record its exact version:
SELECT VERSION();
Identify how MySQL was installed: Oracle’s APT or Yum repository, a downloaded package, Windows, a container image, or a managed database service. The target series is selected differently for each method. Do not change repository sources as if this were a fresh installation; Oracle’s repository may replace packages from a distribution repository, and MariaDB or Percona Server require their own migration plan.
Check that the operating system and architecture are supported for MySQL 9.7 in Oracle’s supported-platform matrix. If the operating system is not supported, plan a supported-host migration instead of assuming that the database package upgrade will work.
2. Check readiness for MySQL 9.7
Install MySQL Shell 26.7, which can check an upgrade to MySQL 9.7.0, and run its Upgrade Checker against the 8.4 server. The checker account needs PROCESS and SELECT privileges. Replace the account, host, port, and configuration-file path for your environment:
mysqlsh -- util check-for-server-upgrade [email protected]:3306 \
--target-version=9.7.0 \
--config-path=/path/to/my.cnf
Enter the password when prompted; do not put it in the command line. Resolve reported errors and review warnings and notices manually. The checker automates only some compatibility checks; it cannot verify that your application’s SQL, drivers, queries, or workload behave correctly on the new server. See Oracle’s MySQL Shell 26.7 Upgrade Checker documentation.
Review changes in MySQL 9.7, including changed or removed SQL modes, server options, variables, and reserved words. Check application and connector support too. A successful Upgrade Checker run is not a substitute for application testing.
3. Back up and rehearse the upgrade
Create a complete backup using a method appropriate for your data size and recovery plan. Include the mysql system database and any required configuration, users, grants, routines, events, and tablespaces. Restore the backup to an isolated test server and verify that the restored databases and application data are usable. A backup file that has not been restored is not a verified recovery plan; see Oracle’s backup and recovery documentation.
Rehearse the upgrade on a clone using the same 8.4 release, operating system, package source, configuration, connectors, and application build as production. Test database connections, representative queries, migrations, scheduled jobs, replication, and backup procedures. Review server and application logs, and compare performance for important workloads.
4. Select the 9.7 LTS series using your installation method
An 8.4 package installation does not necessarily switch to 9.7 automatically. For Oracle repositories, change the selected release series explicitly and verify the target package before upgrading. Follow the procedure that matches the existing installation:
- APT repository: choose
mysql-9.7-ltsin the MySQL APT configuration, refresh the package index, and verify themysql-servercandidate before installing it. See upgrading with the MySQL APT repository. - Yum or DNF repository: disable the 8.4 subrepository, enable the 9.7 LTS subrepository, confirm the enabled repository list, then upgrade the MySQL packages. See upgrading with the MySQL Yum repository.
- Windows: MySQL Configurator documents a supported in-place path from 8.4 to 9.7, and the existing MySQL server must be running for that option to work. Review the detected installation, data path, and configuration before confirming the upgrade. See upgrading MySQL on Windows.
- Docker: follow the official Docker upgrade procedure, pin the intended 9.7 image, and verify the data volume and restore plan before replacing a running container.
- Managed database: use the provider’s version-upgrade workflow and maintenance guidance; repository commands do not apply.
Avoid an unplanned system-wide package update. Check that the package manager selected MySQL 9.7 LTS rather than the Innovation series or another repository’s build.
5. Upgrade and validate the server
Perform the rehearsed steps during the maintenance window. Stop or drain application writes as required by the plan, confirm the final backup, and upgrade through the selected package or provider workflow. MySQL performs server upgrade tasks when the new server starts. Monitor the error log and wait for the server to finish startup before directing application traffic to it.
Verify the target version and service state:
SELECT VERSION();
Then verify databases, users and grants, stored programs, events, application connections, replication, backups, and important query results. Review both MySQL and application logs before reopening normal traffic.
In-place downgrades are not a rollback plan. If validation fails, restore the rehearsed pre-upgrade backup or server snapshot according to the recovery procedure; do not start MySQL 8.4 against a data directory that has been upgraded by 9.7. For systems still running MySQL 8.0, first follow the MySQL 8.0 to 8.4 upgrade guide.