当前位置:Gxlcms > 数据库问题 > 服务器重启后 django无法连接mysql数据库的解决方法

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

时间:2021-07-01 10:21:17 帮助过:11人阅读

问题描述:

 

远程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

```

 

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

标签:sql   远程   运行命令   解决方法   rap   mysql   手动   word   解决   

人气教程排行