Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.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
Postgresql 为什么不是';t Postgres在使用psql时提示输入密码?_Postgresql - Fatal编程技术网

Postgresql 为什么不是';t Postgres在使用psql时提示输入密码?

Postgresql 为什么不是';t Postgres在使用psql时提示输入密码?,postgresql,Postgresql,给定以下pg_hba.conf,为什么Postgres在运行psql-h localhost-p 5555--username=mydb时不提示输入密码 local postgres postgres trust local mydb mydb md5 local mydb mydb password host mydb mydb 0.0.0.0/0 password host mydb mydb 0.0.0.0/0 md5 各国: 用户主目录中的文件.pgpass或PGPASSFILE引用的

给定以下pg_hba.conf,为什么Postgres在运行
psql-h localhost-p 5555--username=mydb
时不提示输入密码

local postgres postgres trust
local mydb mydb md5
local mydb mydb password
host mydb mydb 0.0.0.0/0 password
host mydb mydb 0.0.0.0/0 md5
各国:

用户主目录中的文件.pgpass或PGPASSFILE引用的文件可以包含在连接需要密码时使用的密码(并且没有另外指定密码)


主目录中是否有
.pgpass
文件?@ewcz是的,就是它。请添加您的评论作为回答,我很乐意接受。