Postgres用户不存在? [英] Postgres user does not exist?

查看:496
本文介绍了Postgres用户不存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Postgres,并且已经对其进行了1-2小时的修改.

I have just installed Postgres and have been tinkering with it and various configurations for 1-2 hours.

我坚持无法更改为postgres用户

$ su - postgres产生以下错误:su: unknown login: postgres

$ sudo -u postgres psql产生以下错误:sudo: unknown user: postgres

这些尝试是作为普通用户进行的.以root身份尝试使用它们具有完全相同的结果.我已经在OS X上通过Homebrew安装了postgres,并且已经阅读了很多次说明.

These attempts are made as the normal user. Trying them as root has the exact same results. I have installed postgres via Homebrew on OS X, and I have read the instructions multple times.

推荐答案

psql:使用我的默认用户名登录

psql: Logs me in with my default username

psql -U postgres:以postgres用户身份登录

psql -U postgres: Logs me in as the postgres user

我似乎不需要Sudo.

Sudo doesn't seem to be required for me.

我将Postgres.app用于我的OS X postgres数据库.它消除了确保安装正常运行和数据库服务器正常启动的麻烦.在此处查看: http://postgresapp.com

I use Postgres.app for my OS X postgres database. It removed the headache of making sure the installation was working and the database server was launched properly. Check it out here: http://postgresapp.com

感谢@Erwin Brandstetter纠正了我对参数的使用.

Credit to @Erwin Brandstetter for correcting my use of the arguments.

这篇关于Postgres用户不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆