当前位置:网站首页>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都报一样的错
我的解答思路和尝试过的方法
有没有谁遇到同样的问题,给个思路
边栏推荐
- 学生成绩查找系统
- x86异常处理与中断机制(2)中断向量表
- PAT1009
- Qt读写.ini配置文件
- Visual Studio 2017 ASP.NET Framework MVC 项目 MySQL 配置连接
- redis内存的淘汰机制
- Redis的常用数据结构和底层实现方式
- MySQL执行sql语句的机制
- This application has no explicit mapping for /error, so you are seeing this as a fallback
- Paper Sharing | ACL2022 | Argument Relation Extraction Based on Transfer Learning
猜你喜欢
matlab simulink的scope 示波器光标如何移动记录
电磁场与电磁波-场论基础
【C language】动态数组的创建和使用
wait系统调用
x86 Exception Handling and Interrupt Mechanism (3) Interrupt Handling Process
[Essence] Analysis of the special case of C language structure: structure pointer / basic data type pointer, pointing to other structures
【VIBE: Video Inference for Human Body Pose and Shape Estimation】论文阅读
链表基本操作(详解)
[现代控制理论]3_Phase_portrait 相图 相轨迹
win10 outlook邮件设置
随机推荐
Oracle Database Architecture
[现代控制理论]6_稳定性_李雅普诺夫_Lyapunov
Win10调整磁盘存储空间详解
SQL Server查询优化
双向链表的各种操作
【VIBE: Video Inference for Human Body Pose and Shape Estimation】论文阅读
PAT章节
fork creates multiple child processes
基于STM32F103移植FreeRTOS
PAT1002
【C language】动态数组的创建和使用
杂记(6)
富媒体在客服IM消息通信中的秒发实践
C# async 和 await 理解
百钱买鸡(一)
程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果
PTA 指定位置输出字符串(c)
redis内存的淘汰机制
爱可可AI前沿推介(8.9)
PTA 实验7-5 输出大写英文字母(10 分)