当前位置:Gxlcms > 数据库问题 > Postgresql 用户管理

Postgresql 用户管理

时间:2021-07-01 10:21:17 帮助过:8人阅读

.0.1 psql (9.6.4) Type "help" for help. postgres=# ALTER USER postgres WITH PASSWORD new password;
ALTER ROLE

 

3 修改 pg_hba.conf 访问方式 md5

      host all all 127.0.0.1/32  md5

 常用 ident 默认 与 indent.conf 配合使用

         trust 信任 不需要密码

         reject 拒绝

         password 密码访问 明码

         md5   密码访问 加密**

 

4 测试登录

 

psql -U postgres -h 127.0.0.1
Password for user postgres: 
psql (9.6.4)
Type "help" for help.

postgres=#

 

二,新建用户及授权

 在postgres 中 user 和 role 没有区别,user比role多了一个login访问权限

postgres=# CREATE USER user1;
CREATE ROLE
postgres=# CREATE database db1;
CREATE DATABASE          
postgres=# GRANT ALL ON DATABASE db1 TO user1 ;
GRANT
postgres=# REVOKE ALL ON DATABASE db1 FROM user1;
REVOKE

 

 

Postgresql 用户管理

标签:pass   及授权   rust   ant   用户管理   reject   新建用户   访问权限   127.0.0.1   

人气教程排行