Hi@akhtar,
According to SQL documentation for python library. you need to specify the auth plugin as follows in your code as given below.
conn = mysql.connector.connect(user='root', password='password', host='127.0.0.1',port=5000,database='test',
auth_plugin='mysql_native_password')
Get a further understanding from the SQL Certification Course