I've been trying to connect Python and MySql but I keep getting errors. This is my code:
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="kdvis",
password="root")
print (mydb)
And this is the error I'm getting:
Traceback (most recent call last):
File "C:\Users\kdvis\Desktop\flies\11\python\connection1.py", line 9, in <module>
mydb = mysql.connector.connect(
AttributeError: module 'mysql' has no attribute 'connector'
I've reconfigured MySql, gotten a caching_sha2_password
error, a sha256
password requires SSL error, an access denied for user@localhost
error, tried to change my root password using alter keyword on MySql, and read almost every solution but none worked.
Help would be appreciated very much.