One - One Code All

Blog Content

postgresql忘记登录密码 修改密码

PostgreSQL   2016-05-07 10:14:02

找到安装目录下的data,打开文件夹,找到pg_hba.conf。


用记事本格式打开,拉到最下面,找到所有md5,全都改为trust。


用postgres用户免密码登录即psql控制台,修改密码。


postgres# ALTER USER postgres WITH PASSWORD 'yourpassword';



上一篇:Postgresql UNION 和UNION ALL 用法以及应用场景
下一篇:用 PostgreSQL 的 COPY 导入导出 CSV

The minute you think of giving up, think of the reason why you held on so long.