[英]PostgreSQL OperationalError: could not connect to server
For the first time today I ran into this error: 今天,我第一次遇到这个错误:
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 无法连接到服务器:没有这样的文件或目录服务器是否在本地运行并且在Unix域套接字“ /tmp/.s.PGSQL.5432”上接受连接?
I am running a simple Django blog, locally using PostgreSQL. 我正在本地使用PostgreSQL运行一个简单的Django博客。
When I run: 当我跑步时:
ps auxw | ps auxw | grep postgres grep postgres
I get the following: 我得到以下内容:
Chris 3260 0.5 0.0 2432768 620 s000 R+ 11:37AM 0:00.00 grep postgres
The last time I was able to successfully use PostgreSQL was last night. 我上一次能够成功使用PostgreSQL的时间是昨晚。 I have not changed anything since then, so it might be something to do with my computer maybe? 从那以后我没有做任何更改,因此可能与我的计算机有关吗?
If you need anymore info, just ask me :) Thanks for your help! 如果您需要更多信息,请问我:)谢谢您的帮助!
The problem had to do with the way I shut down my computer. 问题与我关闭计算机的方式有关。 A simple restart fixed my problem. 一个简单的重启解决了我的问题。
The problem is that the PostgreSQL has stopped so must start it. 问题在于PostgreSQL已停止,因此必须启动它。 Try the below command for starting the PostgreSQL: 尝试使用以下命令启动PostgreSQL:
To check the status: 要检查状态:
sudo /etc/init.d/postgres status sudo /etc/init.d/postgres状态
To start: 开始:
sudo /etc/init.d/postgresql start sudo /etc/init.d/postgresql开始
First Of All, You Should have to remove postgres First 首先,您必须先删除postgres
Go To Root 扎根
root@erp-Inspiron-1545:/home/erp# apt-get --purge remove postgresql root @ erp-Inspiron-1545:/ home / erp#apt-get --purge删除postgresql
After Unstalling Postgres 在安装Postgres之后
rm -r /etc/postgresql/ rm -r / etc / postgresql /
rm -r /etc/postgresql-common/ rm -r / etc / postgresql-common /
rm -r /var/lib/postgresql/ rm -r / var / lib / postgresql /
userdel -r postgres userdel -r postgres
groupdel postgres 邮报集团
apt-get install postgresql apt-get安装postgresql
Now Go to Postgres 现在去Postgres
su postgres su postgres
type this command:- 键入以下命令:
alter user postgres with password 'postgres'; 用密码“ postgres”更改用户postgres;
Now Go Back to odoo path & Restart Your server..!!!! 现在返回odoo路径并重新启动服务器.. !!!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.