Fix MySQL Plugin 'mysql-native-password' is not loaded
MySQL since version 8.4, implements the mysql-native-password authentication, which, at the time of writing, has issues when installing on Debian 12 and Ubuntu due to the lack of the necessary plugin. Let’s see how to enable it.
Do you need help with your MySQL configuration? Contact our Linux Assistance and Consultancy, free analysis 30 min.
MySQL Plugin 'mysql-native-password' is not loaded
During the installation of MySQL 8.4, this error is common due to the missing native-password
plugin:
ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded
MySQL 8.4 and later implement mysql-native-password
authentication, which, at the time of writing, has issues when installing on Debian and Ubuntu.
The official documentation suggests two possibilities:
- Enable
mysql_native_password=ON
in the[mysqld]
section of the server configuration, which did not work in our tests. - Start the service with
--mysql-native-password=ON
.
Start the server with --mysql-native-password=ON (added in MySQL 8.4.0), or by including mysql_native_password=ON in the [mysqld] section of your MySQL configuration file.
a. Enabling mysql_native_password
in MySQL configuration
The simplest and most commonly used solution to resolve the ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded
error is to modify the MySQL configuration file and enable the mysql_native_password
plugin.
Simply edit the MySQL configuration file:
nano /etc/mysql/conf.d/mysql.cnf
Add the following line in the
[mysql]
section:[mysql] mysql_native_password=ON
Restart the service:
systemctl restart mysql
Test the authentication:
mysql -u root -p
b. Starting MySQL with --mysql-native-password=ON
in systemd
Even after modifying the server configuration, you may still encounter the ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded
. In this case, we need to modify the systemd unit
that manages MySQL startup.
Edit the MySQL
systemd unit
:nano /etc/systemd/system/multi-user.target.wants/mysql.service
Add
--mysql-native-password=ON
to theExecStart=/usr/sbin/mysqld
line:ExecStart=/usr/sbin/mysqld --mysql-native-password=ON
Reload systemd daemons:
systemctl daemon-reload
Restart MySQL:
systemctl restart mysql
Test the authentication:
mysql -u root -p
Configuring mysql-native-password
More details about mysql-native-password
and native-pluggable-authentication
are available in the official MySQL documentation at the following link:
FAQ's:
1.How to Enable mysql_native_password
?
To enable mysql_native_password
authentication in MySQL 8.4+, you can use one of these methods:
- Modify MySQL Configuration
- Start MySQL with a
systemd
Parameter
For more details, check our guide at the start of the page
2. How to Fix Plugin 'mysql_native_password' is not Loaded
?
This error occurs because the plugin is disabled by default in MySQL 8.4+. Follow two Methods described above to enable it. If the error persists:
Ensure the plugin is loaded by checking:
SHOW PLUGINS;
- Validate that the configuration file uses the correct syntax and section (
[mysql]
or[mysqld]
).
3. How to Enable the mysql_clear_password
Plugin?
The mysql_clear_password
plugin is used for secure authentication methods (e.g., LDAP). Enable it by:
sudo nano /etc/mysql/conf.d/mysql.cnf
Add under [mysqld]
:
[mysqld]
plugin-load-add = mysql_clear_password.so
Security Note: This plugin transmits passwords in cleartext. Use it only with SSL/TLS encryption.
4. Is mysql_native_password
Deprecated?
No, mysql_native_password
is not deprecated as of MySQL 8.4. However, MySQL 8.0+ defaults to caching_sha2_password
for stronger security. To use mysql_native_password
, enable it explicitly via the methods above.
For details, refer to the MySQL 8.4 Native Authentication Documentation.
Need further help? Contact our Linux Assistance Team for a free 30-minute consultation!