简体   繁体   English

postgres.app无法使用我的用户名查找数据库

[英]postgres.app can't find database with my username

When I click Open psql on the Welcome to Postgres window with the fancy blue elephant, it opens a terminal and I get this command and output: 当我用花哨的蓝色大象在“欢迎使用Postgres”窗口中单击“ Open psql时,它将打开一个终端,我得到以下命令并输出:

Tyler-Singer-Clarks-MacBook-Pro:~ Tyler$ '/Applications/Postgres.app/Contents/Version
/9.3/bin'/psql -p5432
psql: FATAL:  database "Tyler" does not exist

Why would this database exist or not exist? 为什么该数据库存在或不存在? (I'm not really sure what is responsible for this database's existence, and thus where I should be looking in order to fix this issue) (我不太确定是什么原因造成了该数据库的存在,以及我应该在哪里寻找解决此问题的方法)

EDIT: and the Welcome window says "You now have a PostgreSQL server running locally." 编辑:并且欢迎窗口显示“您现在有一个本地运行的PostgreSQL服务器”。 And it did not give me an error about not being able to use port 5432. 它并没有给我关于无法使用端口5432的错误。

http://postgresapp.com/documentation/install.html http://postgresapp.com/documentation/install.html

I uninstalled postgresql with brew uninstall postgresql and uninstalled Postgres.app by dragging the elephant from Applications to Trash and Emptying Trash. 我通过将brew uninstall postgresql从“应用程序”拖到“废纸and”和“清空废纸rash”中,用brew uninstall postgresql卸载了Postgresql,并卸载了Postgres.app。 The key thing is to then follow the instructions in the above link and remove ~/Library/Application\\ Support/Postgres . 关键是按照上面链接中的说明进行操作,并删除~/Library/Application\\ Support/Postgres Only then did installing postgresql with brew install postgresql and Postgres.app with the installation instructions in that link finally work. 只有到那时,使用brew install postgresql的安装终于可以了,该链接中的安装说明才能brew install postgresql和Postgres.app。

Classic, "Turn it off, turn it on" solution, but gotta do it fully and correctly. 经典的“关闭,打开”解决方案,但必须完全正确地执行。

Try executing createdb Tyler from the terminal. 尝试从终端执行createdb Tyler

PostgresApp is supposed to create a database with your user name during its setup. PostgresApp应该在设置过程中使用您的用户名创建一个数据库。 Apparently this sometimes fails and requires manual creation. 显然,这有时会失败,需要手动创建。

More info: PostgresApp Issue #139 更多信息: PostgresApp问题#139

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

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