Below error occurred when connecting to mysql server from python.
mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported
Reason:
In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password.
Solution:
1. Simply change the default authentication plugin to mysql_native_password as shown below.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '{Password}';
2. Execute the below command in mysql command line. If plugin column changed to mysql_native_password, then everything is fine.
select Host,User,plugin from mysql.user;