Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 在终端(mac)中键入psql时用户身份验证失败_Macos_Postgresql - Fatal编程技术网

Macos 在终端(mac)中键入psql时用户身份验证失败

Macos 在终端(mac)中键入psql时用户身份验证失败,macos,postgresql,Macos,Postgresql,免责声明:我查看了许多StackOverFlow帖子,但没有一篇帮助我解决这个问题:/ 我在mac Sierra上运行这个 我试图通过键入psql在终端中访问PostgreSQL。 每当我键入psql时,都会出现以下错误: psql: FATAL: password authentication failed for user "JohnSmith" password retrieved from file "/Users/JohnSmith/.pgpass" 在.pgpass文件中,以下是

免责声明:我查看了许多StackOverFlow帖子,但没有一篇帮助我解决这个问题:/ 我在mac Sierra上运行这个

我试图通过键入
psql
在终端中访问PostgreSQL。 每当我键入
psql
时,都会出现以下错误:

psql: FATAL:  password authentication failed for user "JohnSmith"
password retrieved from file "/Users/JohnSmith/.pgpass"
在.pgpass文件中,以下是内容:

localhost:(portnumber):*:JohnSmith:(password)
localhost:(portnumber):*:postgres:(password)
我确认pgpass中JohnSmith的密码与我的Mac用户密码相同

有人能猜出我做错了什么吗