0

I am getting the following error. I have tried all the solutions but can't seem to solve this error:

mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported

Here is my code:

import mysql.connector 
#database=apple table=emp

def addrecord():
    conn=mysql.connector.connect(host="localhost",user='root',passwd="W@2915djkq#",database='apple')
    if conn.is_connected()==False:
        print("CONNECTION ERROR")
        exit()
    cursor=conn.cursor()
    eid=int(input("Enter Employee ID    :"))
    ename=input("Enter employee name:")
    edob=input("Enter date of birth:")
    edept=input("Enter department:")
    edesig=input("Enter designation:")
    esal=float(input("Enter salary:"))
    q="insert into emp values({},'{}','{}','{}','{}',{})".format(eid,ename,edob,edept,edesig,esal)
    cursor.execute(q)
    print("RECORD ADDED SUCCESSFULLY")
    conn.commit()
    cursor.close()

how can i slove this error i try all the solutions but i could not work

reformed
  • 4,505
  • 11
  • 62
  • 88
  • Duplicate of [Authentication plugin 'caching_sha2_password' is not supported](https://stackoverflow.com/questions/50557234/authentication-plugin-caching-sha2-password-is-not-supported) – tomasantunes Jul 02 '23 at 08:03

0 Answers0