Setting the default authentication plug-in to mysql_native_password or Legacy Password Encryption method

Technical Articles

Solution
Application
Content Type
Technical Documentation
Utilities & Services
ft:locale
en-US

Follow the instructions below to set the default authentication plug-in to mysql_native_password or Legacy Password Encryption method.

Note:

The mysql_native_password authentication plugin is deprecated as of MySQL 8.0.34, disabled by default in MySQL 8.4, and removed as of MySQL 9.0.0.

Linux

You can change the default user password authentication plug-in after MySQL 8.0 installation.

  1. Stop the MySQL server.

  2. Open one of the my.cnf options files, and add the following entry:
    [mysqld]
    mysql_native_password=ON

    For more information, see Using Option Files in the MySQL 8.0 Reference Manual.

  3. Restart the MySQL server.

    Note:

    After you restart MySQL, mysql_native_password will be the default authentication plug-in. To verify which users are using the mysql_native_password authentication plug-in, execute the following query:

    SELECT user, Plugin FROM mysql.user;

Windows

You can change the default user password authentication plug-in during or after MySQL 8.0 installation.

During MySQL Installation or Upgrade

When installing or upgrading to MySQL 8.0 using the package installer, select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility) in the Authentication Method step.

For more information, see the following MySQL documentation:

https://dev.mysql.com/doc/mysql-windows-excerpt/8.0/en/mysql-installer-workflow-server.html#server-authentication-method

After MySQL Installation

You can change the default user password authentication plug-in after you have installed MySQL 8.0.

  1. Stop the MySQL server.

  2. Open one of the my.ini options files, and add the following entry:
    [mysqld]
    mysql_native_password=ON

    For more information, see Using Option Files in the MySQL 8.0 Reference Manual.

  3. Restart the MySQL server.
    Note:

    After you restart MySQL, mysql_native_password will be the default authentication plug-in. To verify which users are using the mysql_native_password authentication plug-in, execute the following query:

    SELECT user, Plugin FROM mysql.user;