服务器重启后 django无法连接mysql数据库的解决方法

问题描述:

 

远程linux服务器,centOS7系统 采用uwsgi+django+pymysql的方式连接mysql数据库. 

在服务器重启之后, 启用uwsgi之后(直接运行django运行命令也是一样python manage.py runserver), 无法连接到数据库.

 

报错:

cryptography is required for sha256_password or caching_sha2_password

 

解决方法:

1.

手动连接数据库一次

mysql -u root -p

之后重启uwsgi服务即可.

 

2.

```

pip3 install cryptography

```

 

posted @ 2019-10-14 11:36  冰糖雪梨橙  阅读(516)  评论(0编辑  收藏  举报