GrepBoard/Manuals
605 manuals ·

Fix MySQL 8.4 Plugin 'mysql_native_password' is not loaded

·Tested on MySQL 8.4.13 (Docker mysql:8.4) · 2026-10·Test scope ↓·6 steps

MySQL 8.4 ERROR 1524 means mysql_native_password is disabled by default. Move accounts to caching_sha2_password, or re-enable the plugin for now.

output
ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded

Starting with MySQL 8.4.0 the mysql_native_password plugin is disabled by default, so accounts that authenticate with it cannot log in even with the right password. The fix is to move those accounts to caching_sha2_password; if the app cannot change yet, turn the plugin back on with mysql_native_password=ON for now. The plugin is removed in 9.0.0, so re-enabling only works within 8.4.

The official timeline (Native Pluggable Authentication):

Versionmysql_native_password
8.0.34Deprecated
8.4Built in, disabled by default
9.0.0Removed

[1] Confirm that only some accounts broke after moving from 8.0 to 8.4. On the upgraded data, the old account gets 1524 while a newer one logs in. A socket connection fails the same way.

console
$ mysql -ulegacy -p'<password>' -h127.0.0.1 -e 'SELECT 1'mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded$ mysql -umodern -p'<password>' -h127.0.0.1 -e 'SELECT CURRENT_USER()'mysql: [Warning] Using a password on the command line interface can be insecure.CURRENT_USER()modern@%

[2] Check the plugin status and list the affected accounts. DISABLED confirms this case; the second result is the list of accounts to migrate.

console
$ mysql -uroot -p'<password>' -e "SELECT PLUGIN_NAME, PLUGIN_STATUS FROM information_schema.PLUGINS WHERE PLUGIN_NAME IN ('mysql_native_password','caching_sha2_password')"mysql: [Warning] Using a password on the command line interface can be insecure.PLUGIN_NAME	PLUGIN_STATUScaching_sha2_password	ACTIVEmysql_native_password	DISABLED$ mysql -uroot -p'<password>' -e "SELECT user, host, plugin FROM mysql.user WHERE plugin = 'mysql_native_password'"mysql: [Warning] Using a password on the command line interface can be insecure.user	host	pluginlegacy	%	mysql_native_password

If root is on that list, root is locked out too. Use another admin account, or enable the plugin briefly as in [5] and migrate.

[3] Move the account to caching_sha2_password. ALTER USER … IDENTIFIED WITH needs the password again. Reuse the password already in the app's config and nothing changes on the app side.

console
$ mysql -uroot -p'<password>' -e "ALTER USER 'legacy'@'%' IDENTIFIED WITH caching_sha2_password BY '<password>'; SELECT user, host, plugin FROM mysql.user WHERE user='legacy'"mysql: [Warning] Using a password on the command line interface can be insecure.user	host	pluginlegacy	%	caching_sha2_password

[4] After the move, apps on unencrypted TCP may hit one more error. caching_sha2_password requires a secure connection (TLS, socket) or an RSA key exchange (Caching SHA-2 Pluggable Authentication).

console
$ mysql -ulegacy -p'<password>' -h127.0.0.1 --ssl-mode=DISABLED -e 'SELECT 1'mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.$ mysql -ulegacy -p'<password>' -h127.0.0.1 -e "SELECT CURRENT_USER(); SHOW SESSION STATUS LIKE 'Ssl_version'"mysql: [Warning] Using a password on the command line interface can be insecure.CURRENT_USER()legacy@%Variable_name	ValueSsl_version	TLSv1.3

With TLS it works. If TLS must stay off, have the client fetch the server's public key (--get-server-public-key for mysql; connectors have an equivalent option). Per the docs, after one success the account sits in an in-memory cache and later logins pass without a secure connection, but a server restart, a password change or FLUSH PRIVILEGES empties it and the error returns. "It worked yesterday, broke after a restart" is this case.

console
$ mysql -ulegacy -p'<password>' -h127.0.0.1 --ssl-mode=DISABLED --get-server-public-key -e 'SELECT CURRENT_USER()'mysql: [Warning] Using a password on the command line interface can be insecure.CURRENT_USER()legacy@%

[5] If the app cannot be changed right away, enable the plugin for now. Add one line under [mysqld] and restart (the test used the equivalent startup option --mysql-native-password=ON).

my.cnf ([mysqld] section)
[mysqld]mysql_native_password=ON
console
$ mysql -uroot -p'<password>' -e "SELECT PLUGIN_NAME, PLUGIN_STATUS FROM information_schema.PLUGINS WHERE PLUGIN_NAME='mysql_native_password'"mysql: [Warning] Using a password on the command line interface can be insecure.PLUGIN_NAME	PLUGIN_STATUSmysql_native_password	ACTIVE

When the plugin is used on such a server, the log gets a deprecation warning (one line in the test after creating the account and logging in). The list from [2] must be empty before you move to 9.x.

output
2026-10-27T08:09:39.136083Z 9 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'

[6] If an 8.0 config file still has default_authentication_plugin, 8.4 does not start at all. The variable was removed in 8.4.0 in favor of authentication_policy (What Is New in MySQL 8.4).

output
2026-10-27T08:10:10.638707Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.…2026-10-27T08:10:10.639375Z 0 [ERROR] [MY-010119] [Server] Aborting

Delete that line and start again. The first element of authentication_policy sets the plugin for new accounts; with the 8.4 default *,, that is caching_sha2_password. Do not create new accounts with mysql_native_password on purpose — with the plugin off, CREATE USER … IDENTIFIED WITH mysql_native_password also fails with 1524.

If you get 1045 after migrating, it is the password or the host part. See MySQL ERROR 1045 Access denied (using password: YES).

Analyze your MySQL slow log log in the browser ↗ — nothing is uploaded.

#mysql#mysql-8.4#mysql_native_password#caching_sha2_password#error-1524