美文网首页数据库
'caching_sha2_password' cannot b

'caching_sha2_password' cannot b

作者: 倪大头 | 来源:发表于2019-03-21 12:00 被阅读0次

django访问mysql数据库报错:

django.db.utils.OperationalError: (2059, "Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql-connector-c/6.1.11/lib/plugin/caching_sha2_password.so, 2): image not found")

mysql8.0用户密码加密方式为caching_sha2_password,django暂不支持,需要修改下mysql的加密方式:

登录mysql:

mysql -u root -p

查看当前加密方式:

use mysql;
select user,plugin from user where user='root';

修改加密方式:

alter user 'root'@'localhost' identified with mysql_native_password by 'password';

生效:

flush privileges;

相关文章

网友评论

    本文标题:'caching_sha2_password' cannot b

    本文链接:https://www.haomeiwen.com/subject/tlrqvqtx.html