20246 月20
PostgreSQL 常用命令
- 切换用户
su postgres
pgsql
- 常用命令
\l 列出数据库
\du 列出用户
\q 退出窗口
- 修改密码
su – postgres
pgsql
select usename,passwd from pg_shadow;
ALTER USER demo with password ‘demo12345678’;
或创建用户
CREATE USER demo WITH PASSWORD ‘demo12345678’;
赋予权限
ALTER USER demo WITH SUPERUSER;
ALTER USER demo WITH CreateDB;
创建数据库
CREATE DATABASEdemo
OWNERdemo
;
本文地址:https://wizzer.cn/archives/3786 , 转载请保留.