Can I upgrade from MySQL 8.0 straight to 9?
Quick answer: Not in place. Start MySQL 9 on a data directory left by MySQL 8.0 and it refuses to start, with error MY-014060: upgrade to the next major version is only allowed from the last long term support release. Go through 8.4 first. The sequence, 8.0 to 8.4 to 9.7 to 26.7, was run on one data directory, and every attempt to skip a step was refused.
What is the problem?
Section titled “What is the problem?”MySQL ships in two streams. Long term support releases get years of bug fixes and no new features. Innovation releases add features and are superseded by the next one.
Which series is which changes, so check rather than remember. The official image’s aliases provide the quickest check:
docker run --rm mysql:lts mysqld --versiondocker run --rm mysql:innovation mysqld --versionOn 2026-09-19 the lts tag resolved to 9.7.2 and innovation and latest
both resolved to 26.7.0. 8.4 was the long term support release before 9.7 and
is not the current one. Advice that names a specific version as “the LTS”,
including this page, has a limited shelf life.
The upgrade rule is simple: you may upgrade to the next major version only from the long term support release immediately before it.
What actually happens
Section titled “What actually happens”Run the 8.0 server, create something, stop it cleanly, then start MySQL 9 on the
same data directory. Measured with mysql:8.0.46 and mysql:9.7.2 sharing one
volume:
[ERROR] [MY-014060] [Server] Invalid MySQL server upgrade: Cannot upgrade from 80046 to 90702. Upgrade to next major version is only allowed from the last LTS release, which version 80046 is not.[ERROR] [MY-010020] [Server] Data Dictionary initialization failed.[ERROR] [MY-010119] [Server] AbortingThe container exits. The same skip against 26.7.0 is refused too. The newer server words the error differently, but this is the sentence to search for:
[ERROR] [MY-014060] [Server] Invalid MySQL server upgrade: Cannot upgrade from 80046 to 260700. The source and target must be in the same compatibility lineage, unless the source is the immediately preceding LTS for the target.The refused start also writes to the data directory. Checksumming every file in
the data directory before and after, the failed 9.7.2 start rewrote ibdata1,
#ib_16384_0.dblwr and the redo log, and deleted six spare redo files. InnoDB
initialises before the data dictionary version check runs, so the engine is
already writing when the refusal happens.
On this run the directory survived: the 8.0.46 binary started again on the same volume and the test database was intact. That is one observation on one container, not a guarantee about your data directory, and a failed start is a poor way to test whether your rollback works. Take a backup and restore it somewhere first.
The supported path, run end to end
Section titled “The supported path, run end to end”The same data directory, upgraded in two steps:
| step | version reached | test database present |
|---|---|---|
| start on the 8.0 volume | 8.0.46 | created here |
| replace the binary with 8.4.11 | 8.4.11 | yes |
| replace the binary with 9.7.2 | 9.7.2 | yes |
| replace the binary with 26.7.0 | 26.7.0 | yes |
No error lines in any startup log, and the database created under 8.0 was still listed under 26.7.0. Each step is an in-place upgrade: stop the old server cleanly, start the new one on the same data directory, and it upgrades the data dictionary itself on first start.
Every skip was refused. 8.0.46 to 9.7.2, 8.0.46 to 26.7.0 and 8.4.11 to 26.7.0 all aborted with MY-014060. The rule is one long term support release at a time. The chain is longer than it was, so plan for the number of hops rather than for one maintenance window.
The upgrade is one way in place. Measured by starting 9.7.2 on the 26.7.0 directory:
[ERROR] [MY-014061] [InnoDB] Invalid MySQL server downgrade: Cannot downgrade from 260700 to 90702. Downgrade is only permitted between patch releases.Your rollback is therefore a backup or a replica left on the old version, and you need one of those before you start. A logical export and reload into the old version is a different procedure with its own restrictions, and it is not what “roll back the upgrade” usually means to someone asking at 3am.
Stop cleanly. An unclean shutdown leaves redo to recover, and the new server has to do that recovery before it can run the upgrade. Take a clean shutdown and confirm it in the log.
What to check before either step
Section titled “What to check before either step”The authentication plugin is a common failure point because the accounts survive the upgrade but may stop working:
CREATE DATABASE IF NOT EXISTS upgradeaudit;
SELECT user, host, pluginFROM mysql.userWHERE plugin = 'mysql_native_password'ORDER BY user, host;mysql_native_password is disabled by default in 8.4 and gone in 9.
The difference matters, because 8.4 gives you a transition window and 9 does not.
Measured on 2026-09-20 on MySQL 8.4.11 in a stock mysql:8.4.11 container
started with --mysql-native-password=ON, the plugin is there and usable:
mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM information_schema.plugins WHERE PLUGIN_NAME='mysql_native_password';+-----------------------+---------------+| PLUGIN_NAME | PLUGIN_STATUS |+-----------------------+---------------+| mysql_native_password | ACTIVE |+-----------------------+---------------+
mysql> CREATE USER legacy@'%' IDENTIFIED WITH mysql_native_password BY 'x';Query OK, 0 rows affectedMeasured on 2026-09-20 on MySQL 9.7.2 in a stock mysql:9.7.2 container, the
same option is not a variable any more and the server will not start at all:
[ERROR] [MY-000067] [Server] unknown variable 'mysql-native-password=ON'.[ERROR] [MY-010119] [Server] AbortingThe option allows the 8.4 step while you migrate accounts and test clients. It
does not defer that work. Migrate the accounts while you are still on 8.0 if you
can, and confirm your drivers, pools and proxies speak
caching_sha2_password before the hop. Otherwise the failure appears as an
application outage rather than a startup error.
Then check the configuration file, because a removed variable stops the server rather than being ignored. Two variables present in 8.0.46 are gone by 8.4.11:
default_authentication_plugin.authentication_policycovers the same ground and more, since it sets a plugin per authentication factor rather than one default. It is a rewrite of the setting, not a rename of it.binlog_transaction_dependency_tracking. Removed in 8.4, and the default it used to control changed fromCOMMIT_ORDERtoWRITESETon the way, so replicas apply transactions with more parallelism than they did on 8.0.
SHOW VARIABLES WHERE Variable_name IN ( 'default_authentication_plugin', 'binlog_transaction_dependency_tracking', 'authentication_policy');Measured on 2026-09-20 on MySQL 8.0.46 and MySQL 8.4.11 in stock mysql:8.0.46
and mysql:8.4.11 containers, 8.0.46 returns all three:
+----------------------------------------+-----------------------+| Variable_name | Value |+----------------------------------------+-----------------------+| authentication_policy | *,, || binlog_transaction_dependency_tracking | COMMIT_ORDER || default_authentication_plugin | caching_sha2_password |+----------------------------------------+-----------------------+and 8.4.11 returns one:
+-----------------------+-------+| Variable_name | Value |+-----------------------+-------+| authentication_policy | *,, |+-----------------------+-------+authentication_policy being present on 8.0.46 is useful because it is not a
setting you meet after the upgrade. Set it on 8.0 first, confirm the application
still authenticates, and the replacement is then no longer part of the hop.
This query is a spot check, not a configuration audit. It reads the running server’s system variables, so a startup-only option, a component option or an obsolete alias in your option file can be absent from it and still stop the new binary. Start the target binary against a copy of the configuration in staging and read its log.
Use the upgrade checker rather than mysqlcheck. mysqlcheck --check-upgrade
runs CHECK TABLE ... FOR UPGRADE, which is a per-table check that answers
“is this table readable by the new server”, and it is not shipped in the official
mysql:8.0.46 or mysql:9.7.2 images at all. What you want is MySQL Shell,
which is in both, pointed at the exact version you are moving to:
mysqlsh --uri root@oldserver:3306 -- util check-for-server-upgrade \ --target-version=8.4.11Run it from a shell newer than the server, or it refuses. The shell in the image you are upgrading away from is therefore not suitable. Measured on 2026-09-20, MySQL Shell 8.0.46 pointed at the MySQL 8.0.46 server:
ERROR: Detected MySQL Server version is 8.0.46. MySQL Shell cannot check MySQLserver instances for upgrade if they are at a version the same as or higherthan the MySQL Shell version.Run it once per hop, because each hop has its own findings. Measured on
2026-09-20 with MySQL Shell 9.7.1 against MySQL 8.0.46 in a stock mysql:8.0.46
container, targeting 8.4.11:
Errors: 0Warnings: 24Notices: 2That covers eleven checks: system variables, CHECK TABLE FOR UPGRADE, routine
syntax, foreign keys not referencing a full unique index, user authentication
methods, plugin usage, default authentication methods in system variables,
authentication methods in use by user accounts, column definitions, user
privileges that will be removed, and partitions by key on prefix indexes.
Three of the eleven concern authentication, which is where the 8.0 to 8.4 hop
causes the most trouble. The system variable section replaces the hand-written
list above:
- binlog_transaction_dependency_tracking: default value changed from COMMIT_ORDER to WRITESET.- innodb_adaptive_hash_index: default value changed from ON to OFF.- innodb_change_buffering: default value changed from all to none.- innodb_io_capacity: default value changed from 200 to 10000.- innodb_redo_log_capacity: default value changed from 104857600 to MIN(#vcpu/2, 16)GB.Five of twenty-four, rewrapped from the tool’s own output. Twenty-four changed defaults, not the two named above, and all twenty-four of that run’s warnings came from this one check. A hand-maintained checklist does not keep up with that many, but the tool does.
Some defaults change, and one changes a lot
Section titled “Some defaults change, and one changes a lot”An 8.0 configuration that relied on defaults is a different server after the upgrade. The largest change measured between 8.0.46 and 8.4.11:
| variable | 8.0.46 | 8.4.11 |
|---|---|---|
innodb_io_capacity | 200 | 10000 |
innodb_io_capacity_max | 2000 | 20000 |
That is a fifty-fold increase, and it held at 10000 on 9.7.2 and 26.7.0 as well. The setting is meant to approximate what your storage can actually sustain, so the right value is one you measured rather than one you inherited. It does not raise the ceiling: InnoDB cannot flush faster than the disk allows whatever the number says. It changes how hard background flushing pushes, and on network attached storage with a provisioned limit that can mean queueing and latency where 8.0 was idle.
Compare the two servers rather than reading a release note:
SHOW VARIABLES WHERE Variable_name IN ( 'innodb_io_capacity', 'innodb_io_capacity_max', 'innodb_redo_log_capacity', 'innodb_buffer_pool_size', 'innodb_flush_neighbors', 'innodb_adaptive_flushing');Why does AI-generated code cause this?
Section titled “Why does AI-generated code cause this?”Here the cause is generated plans rather than generated code. Asked how to upgrade MySQL 8.0 to 9, the natural answer is the generic in-place upgrade procedure because that is what the question describes. The procedure is correct for every step except the one that is not allowed. “Upgrade the server” does not imply a version matrix.
A second cause is a runbook that skips the version check because the person writing it upgraded from 8.4 and did not realise the starting point mattered.
How do I stop it coming back?
Section titled “How do I stop it coming back?”Land on the current long term support release and stay there. Ask the lts
tag which one that is on the day you plan the work rather than trusting a number
written down in a runbook, including this page.
Test the upgrade on a copy of the real data directory, not on an empty one. The startup time is a function of your table count, and that is the number your maintenance window needs.
Keep a replica on the old version until the new one has run under real load, because the downgrade path does not exist.
Diff the variables after the upgrade, not before. The defaults that changed are the ones you never set and therefore never think about.
Can MySQL 8.0 be upgraded directly to MySQL 9?
Not in place. Measured by starting a MySQL 9.7.2 server on a data directory left by MySQL 8.0.46, the server refused with 'Invalid MySQL server upgrade: Cannot upgrade from 80046 to 90702. Upgrade to next major version is only allowed from the last LTS release, which version 80046 is not', then aborted. It is a refusal to start, not a warning. A logical dump and reload is a different procedure and is not covered by this check.
What is the supported path?
One long term support release at a time. Measured on one data directory in containers: 8.0.46 to 8.4.11 to 9.7.2 to 26.7.0, every hop in place, the test database present at the end of each. Every skip was refused, including 8.4.11 straight to 26.7.0.
Does the refusal damage anything?
It writes to the directory, and on the measured run it stayed usable. InnoDB starts before the version check runs, so ibdata1, the doublewrite file and the redo log all changed checksum. The 8.0.46 binary then started on that same directory with the test data intact. Treat that as one observation, not a guarantee: take a backup you have restored before you try it.
How long does the in-place upgrade take?
The data dictionary upgrade itself is usually fast, but the honest answer is that it depends on the number of tables rather than the volume of data, and it is not the part that determines your maintenance window. Test the restart on a copy of the real data directory, because that is the only number that applies to you.
Should I go to 9 at all?
Check which series is the current long term support one before deciding, because it moves. As of 2026-09-19 the official mysql image tags lts and innovation point at 9.7.2 and 26.7.0, so 9.7 is the one to land on and stay on, and 26.7 is the fast-moving series. Land on the current LTS unless you need a specific feature from the innovation series.