我正在使用Flask连接到MySQL (8.0)数据库,错误如下:
Authentication plugin 'caching_sha2_password' is not supported我使用下面的sql命令创建了数据库'user‘:
ALTER USER 'my_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;
quit;不过,我一直收到相同的错误。我如何解决这个问题?
我怀疑遗留插件不能再使用了,因为我试图将它包含在my.cnf文件中,并且MySQL服务器在重新启动后无法启动。
发布于 2020-11-22 04:51:00
在我的例子中,使用这个uri很有帮助:
'mysql+mysqlconnector://user:password@localhost/db?auth_plugin=mysql_native_password'
https://stackoverflow.com/questions/64947052
复制相似问题