推荐学习书目
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 · Apr 2, 2022 · 2769 views
    This topic created in 1526 days ago, the information mentioned may be changed or developed.

    第一次使用 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 服务就可以连接了。

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

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

    谢谢!

    45HXlKzal6W56zUJ
        1
    45HXlKzal6W56zUJ  
       Apr 2, 2022
    等到下次无法链接,你就看看 5432 端口还在监听没.没有的话就是你数据库有问题,要不就是你执行的 sql 把数据库干崩了
    est
        2
    est  
       Apr 2, 2022
    打开 pgadmin4 连接也会出现同样的问题。。。。这就跟 django 无关了。估计是你 pg 进程挂了
    u823tg
        3
    u823tg  
       Apr 2, 2022
    你看下 postgresql 的日志
    whatsupbitch
        4
    whatsupbitch  
    OP
       Apr 4, 2022
    @u823tg
    [Imgur]( )
    感觉是不是被攻击了,没有执行过这些命令...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   895 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 20:07 · PVG 04:07 · LAX 13:07 · JFK 16:07
    ♥ Do have faith in what you're doing.