Check out example codes for "raise errors.NotSupportedError( mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported". It will help you in understanding the concepts better.

Code Example 1

#To resolve this error just add auth_plugin 
import mysql.connector

mydb = mysql.connector.connect(
  host="localhost",
  user="username",
  password="password",
  database="db name",
  auth_plugin='mysql_native_password'
)

Code Example 2

You have probably installed mysql-connector instead of mysql-connector-python. So you need to install it again for python3:

pip3 install mysql-connector-python

Learn ReactJs, React Native from akashmittal.com