当我尝试通过jupyter笔记本连接到数据库时,我一直收到错误消息。我尝试了所有的解决方案,比如:重新安装mysql - auth_plugin='mysql_native_password' - python (没有工作),传入参数连接器,确保mysql是最新的,并且与我的python版本(3.9)匹配。我已经尝试了所有的方法,但仍然得到错误。
这是我的代码:
mydb = mysql.connector.connect(
host = 'localhost',
user = 'root',
passwd = 'oxxmcN4Fer7@HQie',
database = 'testdb',
auth_plugin='mysql_native_password'
)发布于 2021-10-07 18:03:53
试一试
pip uninstall mysql-connector-python和
pip install mysql-connector-python 在windows命令行窗口中。
如果失败,请尝试
reconfigure MySql服务器
来自MySql installer
然后在Authentication Method中选择Use Legacy Authentication Method (Retain MySql 5x Compatibility)
Reconfiguring MySql server和reinstalling mysql connector python已经删除了我的错误
https://stackoverflow.com/questions/69451832
复制相似问题