当前位置: 首页 > 知识库问答 >
问题:

升级到优胜美地 10.10 后无法连接到后gresql数据库

苗承
2023-03-14

更新到优胜美地10.10后,我无法连接到我的postgresql数据库。我运行轨道控制台并尝试获取第一个用户,但得到此错误...

>     ➜  game_golf git:(master) ✗ rails c
>     Loading development environment (Rails 4.1.4)
>     [1] pry(main)> User.first
>     PG::ConnectionBad: could not connect to server: Connection refused
>       Is the server running on host "localhost" (::1) and accepting
>       TCP/IP connections on port 5432?
>     could not connect to server: Connection refused
>       Is the server running on host "localhost" (127.0.0.1) and accepting
>       TCP/IP connections on port 5432?
>     from /Users/pauldornfeld/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize'
>     [2] pry(main)>

我该怎么办!我试图重新安装postgresql,重新安装自制。请帮忙!

共有3个答案

鲁城
2023-03-14

你最好使用简单的方法安装http://postgresapp.com/应用程序!我在10.9.4中也遇到了同样的问题。也用10.10。

brew安装postgres在进行任何OS X升级时都会出现问题,因此请避免。因此,安装应用程序,然后:

如果安装无法开箱即用,请将其添加到您的配置文件中。对我来说,我从来没有在我的个人资料中添加以下内容:

export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

这一行必须位于您的个人资料的顶部:

export PATH=/usr/local/bin:$PATH

祝你好运!

毕宇
2023-03-14

检查服务器.log将显示它要查找的目录。将它们添加到您的 postgres 目录应该可以解决此问题。(本来打算在上面发表评论,但没有足够的声誉)

王高超
2023-03-14

我找到了这个。

cd /usr/local/var/postgres
mkdir pg_tblspc pg_twophase pg_stat_tmp

它对我有用。

 类似资料:
  • 我试图连接到localhost,但在浏览器(chrome、ff和safari)上出现以下错误 浏览器与本地主机的连接尝试被拒绝。 我试过了 telnet 127.0。0.1 尝试127.0。0.1... telnet:连接到地址127.0。0.1:连接被拒绝 telnet:无法连接到远程主机 和 Barry$/:curl localhost curl:(7)无法连接到本地主机端口80:连接被拒绝

  • 我用这个命令升级了open ssh:sudo apt-get升级openssh-server 我重新启动了服务器,之后,我无法连接到任何数据库(Wordpress数据库,you'll数据库,phpmyadmin数据库) 对于WordPress我得到:错误建立数据库连接 对于yourls,我得到:数据库配置不正确,或无法连接到数据库 对于phpmyadmin我得到:mysqli_real_conne

  • 问题内容: 我知道存在类似的问题,例如带有MAMP的MySQL不适用于OSX Yosemite 10.10 。但是,我的计算机上确实没有安装MAMP,也没有安装XAMPP。 当我尝试从PrefPane启动mySQL时,什么都没有发生。 当我尝试通过命令行从命令行启动mqSQL时: 任何和所有帮助将不胜感激。我可以提供任何必要的文件输出。 问题答案: 通过安装最新的mySQL版本来解决,请按照此处的

  • AMH7.1官方升级备份软件更新后 已经无法备份数据库到阿里云 腾讯云 七牛云 更新了备份软件 就这样了!

  • 一旦我升级到Flutter2.5.1,我的项目就停止构建和运行,并出现以下错误: /users/admin/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator_android-2.0.0/android/src/main/java/com/baseflow/geolocator/location/locationmapper.

  • 我刚刚通过自制升级到Postgres10.3。我似乎无法通过“psql[数据库名称]”登录我的数据库。 我得到以下错误: