I'm still learning how to work with a databases using python libraries
An operational error has occurred while executing the following code screenshot
Code snippet:
import pymysql
db1=pymysql.connect(host="127.0.0.1",user="root",password='root',port=3306,db='world')
a=db1.cursor()
sql='SELECT * from CITY'
print(a.execute(sql))
Error:
(1045, "Access denied for user 'root'@'localhost' (using password: NO)")
what could be the reason for this?