$ sudo su - postgres $ psql postgres=# CREATE USER yy WITH PASSWORD 'yy'; CREATE ROLE postgres=# CREATE DATABASE blogbase; CREATE DATABASE postgres=# GRANT ALL PRIVILEGES ON DATABASE blogbase to yy; GRANT 修改用户密码
alter user 用户名 with password '新密码'; ALTER ROLE 登录数据库