Linux下postgres忘记密码的处理

进入postgres安装目录,也就是su - postgres后pwd显示的路径,进入pgsql_data下修改pg_hba.conf,将md5修改成trust(无密码登录),在这里插入图片描述

su - postgres,进入到bin目录下,也就是/pgsql/bin,执行psql -U postgres ,
ALTER USER 你的用户名 WITH PASSWORD ‘你的密码’;
再把trust改回md5(密码登录),重启postgres。

你可能感兴趣的:(实践,postgresql)