欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

aboutgpdbpasswordmd5

程序员文章站 2022-05-03 17:18:32
...

gtlions=# alter user gtlions password gtlions;ALTER ROLEgtlions=# select * from pg_shadow; usename | usesysid | usecreatedb | usesuper | usecatupd | userepl | passwd | valuntil | useconfig---------+----------+-------------+----------+-----

gtlions=# alter user gtlions password 'gtlions';
ALTER ROLE
gtlions=# select * from pg_shadow;
 usename | usesysid | usecreatedb | usesuper | usecatupd | userepl |               passwd                | valuntil | useconfig
---------+----------+-------------+----------+-----------+---------+-------------------------------------+----------+-----------
 gtlions |       10 | t           | t        | t         | t       | md56c7d333ce7a7f5882bdc5a232c107d81 |          |
(1 row)

gtlions=# \q

gtlions:~ gtlions$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> password = 'md5' + hashlib.md5("gtlionsgtlions").hexdigest()
>>> password
'md56c7d333ce7a7f5882bdc5a232c107d81'



-EOF-