问题描述

  username@MaLiJun-Ubuntu:~/private$ psql
  psql: FATAL: database "username" does not exist

使用默认用户登陆默认数据库

1 使用默认用户登陆
  sudo su - postgres 2 进入数据库(默认)   psql template1(或
template1, postgres


创建用户组,创建用户,授权用户权限
 1 creating role on pgsql with privilege as "superuser"
 2 
 3 CREATE ROLE username superuser;
 4 eg. CREATE ROLE demo superuser;
 5 Then create user
 6 
 7 CREATE USER username; 
 8 eg. CREATE USER demo;
 9 Assign privilege to user
10 
11 GRANT ROOT TO username;
12 And then enable login that user, so you can run e.g.: psql template1, from normal $ terminal:
13 
14 ALTER ROLE username WITH LOGIN;
View Code

相关文章:

  • 2021-12-09
  • 2021-09-08
  • 2021-09-08
  • 2021-09-08
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2021-09-15
  • 2022-03-01
  • 2022-12-23
相关资源
相似解决方案