The database is upgraded from mysql5.7 to mysql8.4 and the following error message appears in some scenarios:
Plugin 'mysql_native_password' is not loaded
Reason: mysql_native_password plugin (schema) is deprecated in the new version, the new schema is caching_sha2_password, you need to enable the old schema.
Solution Steps:
1. After connecting to the database, use the command SHOW PLUGINS to view the list of plug-ins.
You can see that the status of the plugin [mysql_native_password] is [DISABLED].
Our need to change its status to [ACTIVE], the modification steps are later.
2. Find the configuration file and modify it
Example of configuration file location: C:\ProgramData\MySQL\MySQL Server 8.4\
Add in the last line:
mysql_native_password=ON
3. Restart the mysql service, sample command:
net start mysql84
net stop mysql84
4. Connect to the database again, use the command SHOW PLUGINS to view the list of plug-ins
You can see that the status of the plugin [mysql_native_password] is [ACTIVE].
5. Enable the old authentication plugin [mysql_native_password] for users
ALTER USER 'account' @ 'host' IDENTIFIED WITH 'mysql_native_password' BY 'password';
FLUSH PRIVILEGES;
Examples:
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'root';
FLUSH PRIVILEGES;
At this point, the problem is solved.