神剑山庄资源网 Design By www.hcban.com
PostgreSQL登录
1、可通过客户端pgAdmin III直接登录
2、可通过命令行
命令:psql -h 10.10.10.10 -U user -d postgres -p 5570
-h:数据库IP
-U:登录用户
-d:登录的数据库
-p:登录端口
方法:进入postgreSQL的客户端安装目录(我的安装目录:C:\Program Files\PostgreSQL\9.4\bin),执行psql命令,其中\q表示退出数据库
修改密码
直接执行以下sql即可修改密码
alter user pguser with password 'new password';
补充:PostgreSQL修改密码认证方式
我就废话不多说了,大家还是直接看代码吧~
[postgres@postgres_vm ~]$ psql psql (12.4) Type "help" for help. postgres=# show password_encryption ; password_encryption --------------------- md5 (1 row) postgres=# select * from pg_authid where rolname='hr'; oid | rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | r olpassword | rolvaliduntil -------+---------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------- -----------------------+--------------- 16386 | hr | f | t | f | f | t | f | f | -1 | md566ad2e6b6f adaa9fd11bfcab906e84c8 | (1 row) postgres=# set password_encryption to "scram-sha-256"; SET postgres=# select * from pg_authid where rolname='hr'; oid | rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | r olpassword | rolvaliduntil -------+---------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------- -----------------------+--------------- 16386 | hr | f | t | f | f | t | f | f | -1 | md566ad2e6b6f adaa9fd11bfcab906e84c8 | (1 row) postgres=# alter user hr with password 'Abcd1234'; ALTER ROLE postgres=# select * from pg_authid where rolname='hr'; oid | rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil -------+---------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------- -------------------------------------------------------------------------------------------------------------------------+--------------- 16386 | hr | f | t | f | f | t | f | f | -1 | SCRAM-SHA-256 $4096:dF5WnZnKGXen0mtqZeWldA==$2K8sshkEarHox93X5hmIjKSPxHecXDkjZ56erjIf+dU=:FBbY3+22nVXF83LbfK6DHBK2QpakJA/0RRI3oXs4cdI= | (1 row) postgres=#
以上为个人经验,希望能给大家一个参考,也希望大家多多支持。如有错误或未考虑完全的地方,望不吝赐教。
神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com
暂无PostgreSQL 实现登录及修改密码操作的评论...
更新日志
2024年10月18日
2024年10月18日
- 群星《歌手2024 第4期》[FLAC/分轨][563.76MB]
- RiffKitten-ChaosParade(2024)[24-44,1]FLAC
- RuneKlakegg-Nattevandrer(2024)[24-96]\FLAC
- 赖冰霞.2006-金嗓典藏辑2IN1(南方金点系列)2CD【南方】【WAV+CUE】
- 群星.1988-国语金曲尽精英VOL.2【瑞成】【WAV+CUE】
- 张宇.1999-雨一直下【EMI百代】【WAV+CUE】
- 袁娅维.2021-月亮失眠了(DELUXE)【华纳】【FLAC分轨】
- AlanBroadbent-JazzFunk(2024)[24-44,1]
- 梅艳芳《绝代芳华》开盘母带[低速原抓WAV+CUE]
- ABC唱片-《外国精逊母带直刻神奇黑胶[APE+CUE].
- 群星《天赐的声音第五季 第6期》[320K/MP3][101.43MB]
- 群星《天赐的声音第五季 第6期》[FLAC/分轨][526.16MB]
- 群星《说唱梦工厂 第2期》[320K/MP3][96.37MB]
- 杨宗宪.1994-留你留袂着【有容唱片】【WAV+CUE】
- 李翊君.2005-勇敢的爱【创意唱片】【WAV+CUE】