小编Dum*_*Boy的帖子

在 Windows 10 上更改 PostgreSQL 的默认用户?

我刚刚在 Windows 10 上安装了 PostgreSQL 13。在命令提示符下我执行了以下操作:

\n
C:\\Users\\Max>cd ../postgres\n
Run Code Online (Sandbox Code Playgroud)\n

然后我尝试执行该createdb命令并收到此错误消息:

\n
createdb: error: could not connect to database template1: FATAL:  password authentication failed for user "Max"\n
Run Code Online (Sandbox Code Playgroud)\n

经过一些研究,我知道如果我不\xe2\x80\x99t 指定带有-U username选项的数据库用户,它将采用操作系统用户名。

\n

当我进入postgres用户时,为什么它仍然使用该用户"Max"?\n有没有办法可以将其更改为postgres在我进入时进行身份验证C:\\Users\\Max,这样我就不必每次都指定用户名?

\n

windows postgresql windows-10

5
推荐指数
1
解决办法
6046
查看次数

标签 统计

postgresql ×1

windows ×1

windows-10 ×1