Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.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
Linux 如何使用.pgpass文件中给出的密码连接到postgres?_Linux_Postgresql_Authentication_Psql - Fatal编程技术网

Linux 如何使用.pgpass文件中给出的密码连接到postgres?

Linux 如何使用.pgpass文件中给出的密码连接到postgres?,linux,postgresql,authentication,psql,Linux,Postgresql,Authentication,Psql,我的.pgpass文件位于home/centos目录下,具有0600权限 10.43.11.123:5432:mydb:postgres:abcd@1234 (实际密码包含反斜杠字符。) 我已经尝试了这篇文章中给出的所有方法 什么都不管用 我尝试了中提供的解决方案,但也没有帮助 每次出现错误时: psql:fe_sendauth:未提供密码 我还尝试: psql-h10.43.11.123-d mydb-U postgres 它提示: psql:致命:用户“postgres”的密码身份验证失

我的.pgpass文件位于home/centos目录下,具有0600权限

10.43.11.123:5432:mydb:postgres:abcd@1234
(实际密码包含反斜杠字符。)

我已经尝试了这篇文章中给出的所有方法

什么都不管用

我尝试了中提供的解决方案,但也没有帮助

每次出现错误时:

psql:fe_sendauth:未提供密码

我还尝试:

psql-h10.43.11.123-d mydb-U postgres
它提示:

psql:致命:用户“postgres”的密码身份验证失败 从文件“/home/centos/.pgpass”中检索到密码

有人能帮忙吗?

根据:

如果条目需要包含
\
,请使用
\
转义此字符

因为您说密码包含反斜杠字符,所以解决方案是将该反斜杠加倍