简体   繁体   English

数据库创建时出现连接错误

[英]Connection error at the db creation

I have a rails project, that works with postgresql and pg. 我有一个Rails项目,可与postgresql和pg一起使用。 I installed postgres in my computer, but when I try to create/migrate the db of the aplication, I get the following error: 我在计算机上安装了postgres,但是当我尝试创建/迁移应用数据库时,出现以下错误:

ConnectionBad: 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.5432"? ConnectionBad:无法连接到服务器:没有这样的文件或目录服务器是否在本地运行并且在Unix域套接字“ /var/run/postgresql/.s.PGSQL.5432”上接受连接?

I created already the user for the application. 我已经为该应用程序创建了用户。 I didn't have the postgresql folder at least, I had to create it. 至少我没有postgresql文件夹,我必须创建它。 What could be the problem? 可能是什么问题呢?

I'm using Ubuntu 14.04 我正在使用Ubuntu 14.04

By default the socket connection file is located in the /tmp folder, you can find it in /tmp/.s.PGSQL.5432. 默认情况下,套接字连接文件位于/ tmp文件夹中,您可以在/tmp/.s.PGSQL.5432中找到它。 To change the location check ~/.parts/var/postgresql/postgresql.conf file, but /var/run directory is not writable now, you can't select /var/run as the socket file location. 要更改位置,请检查〜/ .parts / var / postgresql / postgresql.conf文件,但是/ var / run目录现在不可写,您不能选择/ var / run作为套接字文件位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM