我正在使用PostgreSql应用程序的mac(http://postgresapp.com/).我以前在其他机器上使用它但是在我的macbook上安装时给我带来了一些麻烦.我安装了应用程序,然后运行:
psql -h localhost
Run Code Online (Sandbox Code Playgroud)
它返回:
psql: FATAL: database "<user>" does not exist
Run Code Online (Sandbox Code Playgroud)
似乎我甚至无法运行控制台来创建它试图找到的数据库.我跑的时候会发生同样的事情:
psql
Run Code Online (Sandbox Code Playgroud)
或者如果我从应用程序下拉菜单中启动psql:
机器统计:
OSX 10.8.4
psql(PostgreSQL)9.2.4
任何帮助表示赞赏.
我也试图通过自制软件安装PostgreSql,我遇到了同样的问题.我还阅读了应用程序文档页面,其中说明:
当Postgres.app首次启动时,它会创建$ USER数据库,当没有指定时,它是psql的默认数据库.默认用户是$ USER,没有密码.
所以似乎应用程序没有创建$ USER但是我已经安装了 - >卸载 - 重新安装了几次,所以它必须是我的机器的东西.
我找到答案,但我不确定它是如何工作的,因为在这个线程上回答的用户 - > 获取Postgresql在Mac上运行:数据库"postgres"不存在没有跟进.我使用以下命令来打开psql:
psql -d template1
Run Code Online (Sandbox Code Playgroud)
我会留下这个答案,直到有人可以解释为什么这样做.
我有一个使用 postgresql 在本地环境上运行的 Rails 应用程序。今天早上我启动了一个新的,并在安装了 pg gem 等之后。尝试运行时遇到以下错误
psql
Run Code Online (Sandbox Code Playgroud)
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "jackcollins" does not exist
Run Code Online (Sandbox Code Playgroud)
奇怪的是数据库名称“jackcollins”来自我的其他 Rails 应用程序。
我跑了
pgrep -l postgres
Run Code Online (Sandbox Code Playgroud)
输出是
20902 postgres
20919 postgres
20920 postgres
20921 postgres
20922 postgres
20923 postgres
20924 postgres
Run Code Online (Sandbox Code Playgroud)
我不确定如何继续,以便这些应用程序都可以运行自己的 postgres 实例。
我最近卸载了postgresql并通过pip安装了pyscopg2.
我知道libcrypto和libssl涉及一些技巧
目前我将它们符号链接到:
$ ls -lah libssl.*
-rwxr-xr-x 1 root wheel 402K Aug 28 11:06 libssl.0.9.7.dylib
-rwxr-xr-x 1 root wheel 589K Aug 28 11:06 libssl.0.9.8.dylib
lrwxr-xr-x 1 root wheel 55B Nov 29 23:38 libssl.1.0.0.dylib -> /usr/local/Cellar/openssl/1.0.1c/lib/libssl.1.0.0.dylib
lrwxr-xr-x 1 root wheel 55B Nov 30 02:25 libssl.dylib -> /usr/local/Cellar/openssl/1.0.1c/lib/libssl.1.0.0.dylib
/usr/lib
$ ls -lah libcrypto.*
-rwxr-xr-x 1 root wheel 2.1M Aug 28 11:06 libcrypto.0.9.7.dylib
-rwxr-xr-x 1 root wheel 2.6M Aug 28 11:06 libcrypto.0.9.8.dylib
-r-xr-xr-x 1 root wheel 1.6M Oct 31 22:12 libcrypto.1.0.0.dylib
lrwxr-xr-x …Run Code Online (Sandbox Code Playgroud) 当尝试连接到我的工作站上本地运行的 postgres 时,我得到:
$ sudo -u postgres psql -c "create role ..."
could not change directory to "/home/esauer/workspace/cfme"
psql: 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"?
Run Code Online (Sandbox Code Playgroud)
我的 postgres-server 安装在/var/run/postgresql.
如何让客户看向正确的位置?
在 Mac (OSX 10.11.6) 上通过 Homebrew 安装 PostgreSQL 时,出现以下错误:
Error: The `brew link` step did not complete successfully The formula
built, but is not symlinked into /usr/local
Run Code Online (Sandbox Code Playgroud)
和
initdb: file "/usr/local/share/postgresql/postgres.bki" does not exist
This might mean you have a corrupted installation or identified the
wrong directory with the invocation option -L.
Run Code Online (Sandbox Code Playgroud)
该/postgresql文件夹不存在。
不确定它是否相关,但我已经通过 Homebrew 安装了 OpenSSL 1.0.2o_2 和 Readline 7.0.5。
有谁知道为什么会出现此错误以及如何解决它?