I am learning a new library mysql in python. I have tried executing the below command,
import mysql.connector
mydb= mysql.connector.connect(
host= 'localhost',
user= 'root',
passwd= 'skviknesh'
)
print(mydb)
and got the below error!
Traceback (most recent call last):
File "<ipython-input-1-f9b9bc67dd68>", line 3, in <module>
mydb= mysql.connector.connect(
AttributeError: module 'mysql.connector' has no attribute 'connect'
I looked into similar other Stack overflow questions... Didn't get a solution. I tried renaming my file too, that didn't help. Please help on the same!!!