postgres

su - postgres

psql -d aflmdata -U aflm1234

psql -U aflm1234 -W

postgres=# create user <USER_NAME> with password '******';

CREATE ROLE

postgres=# create database <DB_NAME> owner <USER_NAME>;

CREATE DATABASE

postgres=# grant all privileges on database <DB_NAME> to<USER_NAME>;

GRANT

postgres=# \q

-bash-4.2$ exit

alter user ** with password '';

列出所有数据库:\l 或 select datname from pg_database;

切换数据库:\c 数据库

查询最大连接数

select count(1) from pg_stat_activity;

查看当前连接数

show max_connections;

修改最大连接数

cd /nfsc/csp_stg_fls_afch_id009044_vol1001_stg/postgresql    && vim postgresql.conf

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容