无法登录系统用户postgres

编程入门 行业动态 更新时间:2024-10-23 13:31:56
本文介绍了无法登录系统用户postgres的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用brew在Mac上安装了postgresql。在安装过程中,没有要求我输入postgresql的密码。现在我需要创建一个用户,但不能:

I installed postgresql on mac using brew. I wasn't asked about for the password for postgresql during the installation. Now I need to create a user and can't:

Alexs-MacBook-Air:mydir alex$ su - postgres Password: su: Sorry

无论我使用什么密码(包括空密码),是错的。重置它最简单的方法是什么?

Whatever password (including empty) I use, it is wrong. What's the easiest way to reset it?

推荐答案

您正试图访问名为 system 的用户 postgres 。根据您在其他答案上留下的评论,没有这样的用户。您无法更改不存在的用户的密码。

You're trying to access the system user named postgres. According to comments you left on the other answers, there is no such user. You can't change the password of a user that doesn't exist.

也许是 _postgres 或 postgres _ ?我知道OS X上的某些安装程序使用奇怪的名称。抑或是您的安装一开始就没有在您的系统上成功创建 postgres 用户,因此您无法为其设置密码?

Perhaps it's _postgres or postgres_? I know some installers on OS X use weird names. Or perhaps your install never successfully created a postgres user on your system in the first place, so you can't set a password for it?

通常,您无需为此用户设置密码。您可以

sudo -u postgres psql

或您需要以 postgres 超级用户身份运行的任何命令。

or whatever command you need to run as the postgres superuser.

请注意,您不需要 su 。

更多推荐

无法登录系统用户postgres

本文发布于:2023-10-16 16:19:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498077.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户   系统   postgres

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!