简体   繁体   English

MySQL 接口错误,如何解决?

[英]MySQL Interface Error, how do I fix this?

I am using mysql to connect to a sql database, and when I run the following code:我正在使用 mysql 连接到 sql 数据库,当我运行以下代码时:

engine = sqlalchemy.create_engine(f'mysql+mysqlconnector://{user}:{password}@{server}:{port}/{schema}', echo=False)

I receive back the following error:我收到以下错误:

    InterfaceError: (mysql.connector.errors.InterfaceError) sha256_password requires SSL
    (Background on this error at: https://sqlalche.me/e/14/rvf5)

Does anyone have any advice on how to fix this?有没有人对如何解决这个问题有任何建议?

The message tells you that the user uses the new athentification method that is not yet supported该消息告诉您用户使用了尚不支持的新认证方法

Change the user to a legacy password and then you can connect将用户更改为旧密码,然后您可以连接

For that you must run following comand, of course adapted to your configuration为此,您必须运行以下命令,当然要根据您的配置进行调整

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM