【问题标题】:Setting up PostgreSQL, could not connect to database postgres设置 PostgreSQL,无法连接到数据库 postgres
【发布时间】:2014-08-14 20:51:36
【问题描述】:

我将在 Debian 7 上使用 postgreSQL 9.2 创建一个 django 应用程序。 我在数字海洋中创造了一个水滴。我更新并升级了系统。 我使用了以下命令

sudo aptitude install postgresql postgresql-contrib

安装 postgresql。

当我将用户更改为 postgres 并且我想使用 createuser -P 创建一个新的 db 用户时

我填写了它想要的所有字段,但出现了这个错误:

createuser: could not connect to database postgres: 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"?

我在 Ubuntu 12.04 和 Debian 7 中使用新的 droplets 尝试了几次相同的过程。

我该怎么办? 我想使用 Debian 7,所以我更喜欢使用 Debian 的解决方案。 我是这方面的新手,所以请解释一下。 谢谢。

【问题讨论】:

  • 您是否尝试过使用initdb 创建postgres 数据库集群?
  • 我该怎么做? :)
  • 使用 postgres 手册:postgresql.org/docs/current/static/app-initdb.html 或谷歌 postgres initdb
  • 谢谢。我正在寻找它。
  • "服务器是否在本地运行并接受 Unix 域套接字上的连接..."

标签: file postgresql directory


【解决方案1】:

我通过修复语言环境问题解决了这个问题并重新安装了 PostgreSQL

首先: http://perlgeek.de/en/article/set-up-a-clean-utf8-environment

第二: How to thoroughly purge and reinstall postgresql on ubuntu?

设置语言环境并为 postgreSQL 进行全新安装。

谢谢!

【讨论】:

    猜你喜欢
    • 2021-02-12
    • 2017-11-12
    • 2017-11-27
    • 1970-01-01
    • 2014-03-30
    • 2013-04-19
    • 1970-01-01
    • 2022-12-03
    • 2022-12-05
    相关资源
    最近更新 更多