Dum*_*Boy 5 windows postgresql windows-10
我刚刚在 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,这样我就不必每次都指定用户名?
没关系,我找到了答案。
\n右键单击 Windows 图标,然后单击 \xe2\x80\x9cSystem\xe2\x80\x9d
\n向下滚动到 \xe2\x80\x9c高级系统设置\xe2\x80\x9d
\n单击环境变量
\n在\xe2\x80\x9c系统变量\xe2\x80\x9d中,单击\xe2\x80\x9cNew\xe2\x80\x9d:
\n变量名称:PGUSER
变量值:postgres
| 归档时间: |
|
| 查看次数: |
6046 次 |
| 最近记录: |