【问题标题】:Multiple Instances of Postgresql ConflictingPostgresql冲突的多个实例
【发布时间】:2015-04-25 21:44:09
【问题描述】:

我有 ubuntu linux 服务器。我在上面安装了 postgresql 9.3,但是为了安装一个扩展,我错误地将 postgresql 服务器升级到了 9.4。仍然一切正常,但服务器重启后我无法连接到 postgresql 9.3, 我收到错误无法连接到服务器:没有这样的文件或目录,服务器是否在本地运行并接受 unix 域套接字“var/run/postgresql/.s.PGSQL.5432”上的连接?

如果我查看 var/run/postgresql,我看不到 .s.PGSQL.5432 而是 .s.PGSQLl.5433。 我需要在端口 5432 上连接到 postgresql,因为我所有的数据库都在上面。 有人可以告诉我,我怎样才能在不丢失任何数据的情况下访问端口 5432 上的 postgresql 服务器。

【问题讨论】:

    标签: postgresql ubuntu


    【解决方案1】:

    Ubuntu 允许同时运行多个版本的 PostgreSQL。从进程列表 (ps aux) 中可以看出 9.3 @ 5432 确实在运行;如果没有,请以sudo service postgresql start 9.3 开头。

    【讨论】:

    • 在运行 ps aux 之后,我看到了很多 postgresql 服务,但是我怎么知道运行的是哪个版本的 postgresql。在running sudo service postgresql restart 之后,它要求输入 postgres 密码。我也丢失了 postgres 的密码
    • 试试用我给的命令启动postgresql 9.3,很安全。
    • @Antii Haapala,你能看看我更新的评论吗
    • @SahilAgarwal 不,它要求输入 您的 密码,或者您应该使用您的帐户执行此命令。
    • 它要求我丢失了 postgres 密码。我有 root 访问权限
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-16
    • 1970-01-01
    • 2016-11-01
    • 1970-01-01
    • 2011-11-20
    • 2016-07-25
    相关资源
    最近更新 更多