Postgres数据库忘记密码,三个步骤解决(windows下)
2016-07-08 00:00
288 查看
一、修改data目录下的 pg_hba.conf 文件
将以下这行
host all all 127.0.0.1/32 md5
改为如下:
host all all 127.0.0.1/32 trust
二、运行cmd,进入postgres安装路径的bin目录,运行如下命令:
psql -U postgres
postgres=# alter user postgres with password '你要设置的密码';
postgres=# \q
三、修改data目录下的 pg_hba.conf 文件
将以下这行
host all all 127.0.0.1/32 trust
改为如下:
host all all 127.0.0.1/32 md5
重新启动postgres
将以下这行
host all all 127.0.0.1/32 md5
改为如下:
host all all 127.0.0.1/32 trust
二、运行cmd,进入postgres安装路径的bin目录,运行如下命令:
psql -U postgres
postgres=# alter user postgres with password '你要设置的密码';
postgres=# \q
三、修改data目录下的 pg_hba.conf 文件
将以下这行
host all all 127.0.0.1/32 trust
改为如下:
host all all 127.0.0.1/32 md5
重新启动postgres
相关文章推荐
- win7-64下安装绿色mysql
- 防止SQL注入和XSS攻击Filter
- Spring Data MongoDB - Reference Documentation
- 更改MYSQL数据库不区分大小写表名
- Linux 下MongoDB的安装以及使用
- MongoDB的备份(mongodump)与恢复(mongorestore)
- Mongodb开启与关闭
- win7下安装非关系型数据库MongoDB
- mongodb like查询
- CAS 服务器在WAS V7中集群将票据保存到数据库
- Xmemcached使用之与Spring整合
- MySQL中INSERT INTO SELECT的使用
- Mongodb的update操作
- MongoDB Java Tutorial
- oracle恢复误删除数据,解除锁定等非常经典实用方法
- CAS配置(二)- 集成 oracle BerkeleyDB
- MySQL binlog
- 打开sql server jdbc的日志功能的方法
- SQL server jdbc之prelogin数据包
- SQL Server 获取服务器时间的sql语句