我刚刚在 Windows 10 上安装了 PostgreSQL 13。在命令提示符下我执行了以下操作:
\nC:\\Users\\Max>cd ../postgres\nRun Code Online (Sandbox Code Playgroud)\n然后我尝试执行该createdb命令并收到此错误消息:
createdb: error: could not connect to database template1: FATAL: password authentication failed for user "Max"\nRun Code Online (Sandbox Code Playgroud)\n经过一些研究,我知道如果我不\xe2\x80\x99t 指定带有-U username选项的数据库用户,它将采用操作系统用户名。
当我进入postgres用户时,为什么它仍然使用该用户"Max"?\n有没有办法可以将其更改为postgres在我进入时进行身份验证C:\\Users\\Max,这样我就不必每次都指定用户名?