V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
whatsupbitch
V2EX  ›  Python

django postgresql 过一段时间就无法链接

  •  
  •   whatsupbitch · 2022-04-02 10:38:14 +08:00 · 1828 次点击
    这是一个创建于 727 天前的主题,其中的信息可能已经有所发展或是发生改变。

    第一次使用 postgresql ,ubuntu20 postgresql12 版本。过一段时间 django 就报 500 错误,查看日志显示

    Is the server running on host "127.0.0.1" and accepting
    	TCP/IP connections on port 5432?
    

    打开 pgadmin4 连接也会出现同样的问题。

    但是重启 postgresql 服务就可以连接了。

    在网上搜错误提示,也是告诉你要启动服务~~~

    请问有人遇到过么? 该如何解决?

    谢谢!

    dicc
        1
    dicc  
       2022-04-02 10:52:43 +08:00
    等到下次无法链接,你就看看 5432 端口还在监听没.没有的话就是你数据库有问题,要不就是你执行的 sql 把数据库干崩了
    est
        2
    est  
       2022-04-02 10:56:10 +08:00
    打开 pgadmin4 连接也会出现同样的问题。。。。这就跟 django 无关了。估计是你 pg 进程挂了
    u823tg
        3
    u823tg  
       2022-04-02 17:30:52 +08:00
    你看下 postgresql 的日志
    whatsupbitch
        4
    whatsupbitch  
    OP
       2022-04-04 20:28:13 +08:00
    @u823tg
    [Imgur]( )
    感觉是不是被攻击了,没有执行过这些命令...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5440 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:53 · PVG 16:53 · LAX 01:53 · JFK 04:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.