import mysql.connector
mydb = mysql.connector.connect(
host="localhost", # 数据库主机地址
user="root", # 数据库用户名
password="a2251698", # 数据库密码
auth_plugin = 'mysql_native_password'
)
print(mydb)
--------------------------------------------------------------------------- NotSupportedError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_27744/542995535.py in <module> 1 import mysql.connector 2 ----> 3 mydb = mysql.connector.connect( 4 host="localhost", # 数据库主机地址 5 user="root", # 数据库用户名 C:\ProgramData\Anaconda3\lib\site-packages\mysql\connector\__init__.py in connect(*args, **kwargs) 177 return CMySQLConnection(*args, **kwargs) 178 else: --> 179 return MySQLConnection(*args, **kwargs) 180 Connect = connect # p