2017-08-02 59 views
0

我试图运行Django的迁移来更新我的数据库,但“manage.py迁移”无法连接到我的postgresql数据库。奇怪的是:我的django网站(这是完全相同的代码)正在工作,包括连接到数据库。django网站工作,但Django的manage.py无法连接到db

错误消息:

psycopg2.OperationalError: could not connect to server: No such file or directory 
     Is the server running locally and accepting 
     connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.xxxxxx"? 

django.db.utils.OperationalError: could not connect to server: No such file or directory 
     Is the server running locally and accepting 
     connections on Unix domain socket "/var/run/postgresql/.s.PGSQL 

回答

-1
+1

强烈建议仅限链接回答。如果您发布的链接有关于此事的有价值的信息,请在此复制相关信息(假设许可证允许)或将其与链接一起总结。我们永远不知道链接何时会失效。 – spectras

+0

@spectras我更关心Google寻找我的答案,以便其他人可以从中受益。链接指向更多信息。我只是在stackoverflow上包含这个问题和答案,以便其他人可以找到它。当我面临这个问题时,答案并不是在计算器上,当有人发现它时,我感到非常幸运和欣赏。所以,我传递了良好的业力。 – TaiwanGrapefruitTea