Databases and Redis · Step-by-step tutorial
MySQL will not start after the upgrade from 8.0 to 8.4
Short answer
unknown variable 'default_authentication_plugin=mysql_native_password' followed by Aborting means an option file still sets something MySQL 8.4 removed, for example after moving from 8.0, as Ubuntu 24.04 to 26.04 does. Run mysqld --validate-config, drop default_authentication_plugin (authentication_policy replaces it), turn expire_logs_days into binlog_expire_logs_seconds, and delete the other removed options. MySQL 8.4.
MySQL 8.4 stops at start-up when an option file contains a setting that the server no longer knows. The log line reads unknown variable '...' followed by Aborting, and the service never comes up. After a jump from 8.0 to 8.4, for instance through a distribution upgrade, old files are the usual source, especially default_authentication_plugin and expire_logs_days.
MySQL's list of features removed in 8.4 names the options below. Because the server reports only the first bad line each time, the quickest way through is a loop: validate, fix one line, validate again, until the exit code is 0.
Before you start
- Root access on the server and the paths of your option files (commonly
/etc/mysql/or/etc/my.cnf). - A copy of those files taken before you edit them.
- A list of accounts that still use
mysql_native_password, if you have any.
Step 1
Take a backup and run the validator
- Copy the option files somewhere safe.
- Run the server's own checker.
--validate-configparses the configuration without starting the server and exits with 1 on the first error. - Search the option files for the names you are about to meet.
Back up, validate, search
sudo cp -a /etc/mysql /root/mysql-conf-backup
sudo mysqld --validate-config --user=mysql; echo "exit code $?"
sudo grep -rnE "default.authentication.plugin|expire.logs.days" /etc/mysql/ /etc/my.cnf /etc/my.cnf.d/ 2>/dev/nullStep 2
Replace default_authentication_plugin
The manual lists default_authentication_plugin as removed in 8.4, to be replaced by authentication_policy, whose syntax is different. Delete the line. Do not copy the old value across as if it were the same setting.
A second change hides behind this one. From 8.4.0 the mysql_native_password plugin is no longer enabled by default, so accounts created with it can stop logging in even when the server starts. If you still have such accounts, enable the plugin explicitly for the time being and plan to move them to caching_sha2_password.
In the [mysqld] section
[mysqld]
# default_authentication_plugin = mysql_native_password (delete)
mysql_native_password = ON # only while some accounts still need itCheck afterwards which accounts depend on it: SELECT user, host FROM mysql.user WHERE plugin = 'mysql_native_password';.
Step 3
Convert expire_logs_days to seconds
expire_logs_days is removed. Its replacement binlog_expire_logs_seconds counts seconds, so multiply days by 86400: ten days is 864000. Leave the setting out to take the server default of 2592000 seconds, which is 30 days.
Ten days in seconds
[mysqld]
# expire_logs_days = 10 (delete)
binlog_expire_logs_seconds = 864000Step 4
Other options the same release dropped
The 8.4 removal list also covers these server options, which turn up in older option files. Some have a direct replacement.
| Old option | What to do in 8.4 |
|---|---|
| skip-host-cache | Use host_cache_size = 0 |
| ssl, admin-ssl | Use tls_version and admin_tls_version |
| innodb, skip-innodb | Delete; InnoDB is always on |
| old, new, language | Delete; no replacement |
| character-set-client-handshake, old-style-user-limits | Delete; no replacement |
| avoid_temporal_upgrade, show_old_temporals | Delete |
| binlog_transaction_dependency_tracking | Delete; writeset behaviour is now fixed |
have_ssl and have_openssl were removed as well, so a monitoring query or script that reads them will break after the upgrade.
Step 5
Run the loop until it exits 0
- Run
sudo mysqld --validate-config --user=mysqlagain. - If it names another option, find the file with
grep -rn, fix it and repeat. - When the exit code is 0, start the service with the name your install uses, such as
sudo systemctl start mysql. - Log in and confirm:
SELECT VERSION();shows 8.4 and your applications connect.
If validation passes and the service still fails, the cause is not an option file. Read the error log for upgrade, data directory or permission messages.
It worked when
- Unknown variable at start means an option that 8.4 removed is still in a file.
- Validate, fix one line, validate again.
- mysql_native_password is off by default in 8.4; enable it only while accounts need it.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.