今天在配置django+mysql时碰到一个诡异的问题,就是无法连接上mysql报错1
2
3
4
5
6
7
8
9
10django.db.utils.OperationalError: (2006, <NULL>)
或者
django.db.utils.OperationalError: (2059, "Authentication plugin 'b'sha256_passwo
rd'' not configured")
或者
django.db.utils.InternalError: (1862, 'Your password has expired. To log in you
must change it using a client that supports expired passwords.')
或者
django.db.utils.OperationalError: (1045, "Access denied for user 'cyd'@'localhos
t' (using password: YES)")
其他配置都正确的情况下,只要改变密码编码方式就好了,可以用navicat for mysql 选择用户插件为mysql_native_password就行了
如果遇到1
2django.db.utils.OperationalError: (1045, "Access denied for user 'cyd'@'localhos
t' (using password: NO)")
改完密码编码后重启终端再连接即可