我想将Django应用程序连接到mysql数据库。推荐的解决方案是通过pip安装mysqlclient。但是通过共享主机服务提供的接口安装失败。
我尝试在ssh上安装,错误日志是相当错误的,并且有一个关于权限的错误。共享主机服务中没有sudo命令的访问权限。
发布于 2021-09-25 13:46:08
使用PyMySQL纯python实现的python Django解决方案。
1. pip install PyMySQL or PyMySQL = "*" in Pipfile
2. Editing __init__.py in base or config directory where settings.py exits
import pymysql
pymysql.version_info = (1, 4, 2, "final", 0)
pymysql.install_as_MySQLdb()如果您需要更多具体的用例,请随时分享。
https://stackoverflow.com/questions/56267120
复制相似问题