python中的MySql错误无法连接到MySql s

2024-04-23 21:14:07 发布

您现在位置:Python中文网/ 问答频道 /正文

你好,我有一个问题:

我的意见:

import mysql.connector
import mysql.connector

mydb = mysql.connector.connect(
    host = 'localhost',
    user = 'root',
    passwd = 'ananthjeahinowiamshowingmypasswordwitchisnotmypassword'
)
print(mydb)

这是输出:

mysql.connector.errors.NotSupportedError: Authentication plugin 
'caching_sha2_password' is not supported

Tags: importlocalhosthostconnectorconnectmysqlrootpasswd
2条回答

现在可以了谢谢

我使用了一个mysql插件,所以它会工作

谢谢

安装python-MySQL驱动程序
official document
Similiar stack question
只需确保根据您的操作系统、MySQL版本和Python版本安装正确的连接器 pip安装mysql连接器python

相关问题 更多 >