postgresql创建用户

时间:2023-01-12 03:49:12

(1)内部命令create user 用户名 with superuser password '密码';   

          先进入数据库后用命令\h create user 查看帮助
postgresql创建用户
 
 
with后面是一些参数。superuser 是指定创建超级用户。createdb 指新用户有创建数据库的权限 password 是指定密码。
 

(2)外部shell命令: createuser 用户名  -s  -P '密码'

在linux命令行使用命令创建。在shell中用命令createuser --help查看帮助 
postgresql创建用户
 
-s 是指成为超级用户,-P(大定)是指定密码