当前位置:网站首页>Django 无法链接mysql数据库
Django 无法链接mysql数据库
2022-08-09 11:30:00 【CSDN问答】
Django 无法链接mysql数据库
自己写的python 脚本可以连接上数据库,
pymysql.connect(host = host, user = username, password=pwd, database = database_name)
但是启动Django 整个服务的时候就无法链接上了
运行结果及报错内容
/root/.local/lib/python3.6/site-packages/paramiko/transport.py:169: CryptographyDeprecationWarning: Blowfish has been deprecated'class': algorithms.Blowfish,System check identified no issues (0 silenced).Unhandled exception in thread started by .wrapper at 0x7fcf8f215e18>Traceback (most recent call last):File "/root/.local/lib/python3.6/site-packages/pymysql/connections.py", line 614, in connect(self.host, self.port), self.connect_timeout, **kwargsFile "/usr/local/python3/lib/python3.6/socket.py", line 724, in create_connectionraise errFile "/usr/local/python3/lib/python3.6/socket.py", line 713, in create_connectionsock.connect(sa)ConnectionRefusedError: [Errno 111] Connection refusedDuring handling of the above exception, another exception occurred:Traceback (most recent call last):django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'xx.db.com' ([Errno 111] Connection refused)")
python3.6, 和3.7都报一样的错
我的解答思路和尝试过的方法
有没有谁遇到同样的问题,给个思路
边栏推荐
猜你喜欢
随机推荐
【概率论】正态分布的由来——从大一同学的视角出发
Qt获取EXE可执行文件的上一级目录下的文件
PAT1009
mysql + redis + flask + flask-sqlalchemy + flask-session 配置及项目打包移植部署
STemwin中GUI_Exec和GUI_Delay
【概率论】一元概率分布的平均化
论文分享 | ACL2022 | 基于迁移学习的论元关系提取
ZOJ 1729 & ZOJ 2006(最小表示法模板题)
x86 Exception Handling and Interrupt Mechanism (1) Overview of the source and handling of interrupts
【C language】动态数组的创建和使用
fork creates multiple child processes
[现代控制理论]4_PhasePortrait爱情故事动态系统分析
富媒体在客服IM消息通信中的秒发实践
七夕?程序员不存在的~
CentOS6.5 32bit安装Oracle-11gR2步骤说明
UNIX Philosophy
fork创建多个子进程
Chinese valentine's day?Programmers don't exist
bat文件(批处理文件)运行时一闪而过解决方法
wpf实现简易画板功能(带截取画板,签名截图等等)