vim/var/lib/pgsql/13/data/pg_hba.conf # "local" is for Unix domain socket connections only localallallpeer # IPv4 local connections: hostallall127.0.0.1/32scram-sha-256 hostallall0.0.0.0/0md5# 注意这个,登录需要密码 # IPv6 local connections: hostallall::1/128scram-sha-256 # Allow replication connections from localhost, by a user with the # replication privilege. localreplicationallpeer hostreplicationall127.0.0.1/32scram-sha-256 hostreplicationall::1/128scram-sha-256 hostallall0.0.0.0/0ident
sudo -u postgres psql postgres could not change directory to "/home/xopsadmin/pipeline": Permission denied psql (13.7) Type "help"forhelp. # 创建用户 postgres=# create user devops with password 'devops'; # 创建数据库 postgres=# create database vault_db owner devops; # 授权 postgres=# grant all privileges on database vault_db to devops; # 修改管理员密码 # ALTER USER postgres WITH PASSWORD 'postgres'; # 查看数据库 \list