今天下午 陷进去了 其实很简单的一个事情结果浪费了 接近一个小时. 做事情必须要细致一些. 自己的确做的不好.

这里面简单说一下pg_hba.conf 和 postgresql 密码的一些设置问题.

1. windows 机器

安装pg 时 有一个 让输入密码的地址 这个 直接输入密码就可以了.

然后如果想修改密码的话 可以在命令行里面处理.:

然后修改 data 目录下面的 : pg_hba.conf

注意里面的配置文件内容:

The first field is the connection type: "local" is a Unix-domain
socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
"hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
plain TCP/IP socket. DATABASE can be "all", "sameuser", "samerole", "replication", a
database name, or a comma-separated list thereof. The "all"
keyword does not match "replication". Access to replication
must be enabled in a separate record (see example below). USER can be "all", a user name, a group name prefixed with "+", or a
comma-separated list thereof. In both the DATABASE and USER fields
you can also write a file name prefixed with "@" to include names
from a separate file. ADDRESS specifies the set of hosts the record matches. It can be a
host name, or it is made up of an IP address and a CIDR mask that is
an integer (between and (IPv4) or (IPv6) inclusive) that
specifies the number of significant bits in the mask. A host name
that starts with a dot (.) matches a suffix of the actual host name.
Alternatively, you can write an IP address and netmask in separate
columns to specify the set of hosts. Instead of a CIDR-address, you
can write "samehost" to match any of the server's own IP addresses,
or "samenet" to match any address in any subnet that the server is
directly connected to. METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
"gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
Note that "password" sends passwords in clear text; "md5" or
"scram-sha-256" are preferred since they send encrypted passwords. OPTIONS are a set of options for the authentication in the format
NAME=VALUE. The available options depend on the different
authentication methods -- refer to the "Client Authentication"
section in the documentation for a list of which options are
available for which authentication methods. Database and user names containing spaces, commas, quotes and other
special characters must be quoted. Quoting one of the keywords
"all", "sameuser", "samerole" or "replication" makes the name lose
its special character, and just match a database or username with
that name. This file is read on server startup and when the server receives a
SIGHUP signal. If you edit the file on a running system, you have to
SIGHUP the server for the changes to take effect, run "pg_ctl reload",
or execute "SELECT pg_reload_conf()". Put your actual configuration here

2. linux机器的话 也不复杂

而且 postgres 用户的话 不需要输入密码就可以登录了 能够直接修改密码...

其他配置文件都是一样的.

Postgresql 密码设置的更多相关文章

  1. 更改MySQL/Postgresql密码

    Parrot包括几个SQL引擎,但是当它们被预先安装时,默认密码未被配置,并且拒绝访问其root用户. 重新配置Mysql / Mariadb密码 停止MySQL服务. sudo service my ...

  2. redis密码设置、访问权限控制等安全设置

    redis作为一个高速数据库,在互联网上,必须有对应的安全机制来进行保护,方法有2,如下. 1.比较安全的办法是采用绑定IP的方式来进行控制.  请在redis.conf文件找到如下配置 # If y ...

  3. GRUB密码设置

    通过编辑GRUB启动参数可以轻松的进入单用户模式从而修改root密码,GRUB的密码设置可分为全局密码和菜单密码. 一,全局密码设置     在splashimage这个参数的下一行可以加上passw ...

  4. Linux - root初始密码设置

    Ubuntu刚安装后,不能在terminal中运行su命令,因为root没有默认密码,需要手动设定. 以安装ubuntu时输入的用户名登陆,该用户在admin组中,有权限给root设定密码. 给roo ...

  5. xampp默认mysql密码设置,修改mysql的默认空密码

    xampp默认mysql密码设置,修改mysql的默认空密码 分类: xampp2012-09-12 11:24 30264人阅读 评论(5) 收藏 举报 mysqlphpmyadminauthent ...

  6. (转)mysql账号权限密码设置方法

    原文:http://www.greensoftcode.net/techntxt/2013410134247568042483 mysql账号权限密码设置方法 我的mysql安装在c:\mysql 一 ...

  7. ubuntu 第一次安装时 默认root 密码设置

    Ubuntu刚安装后,不能在terminal中运行su命令,因为root没有默认密码,需要手动设定. 以安装ubuntu时输入的用户名登陆,该用户在admin组中,有权限给root设定密码. 给roo ...

  8. Spring+SpringMVC+MyBatis+easyUI整合进阶篇(十一)redis密码设置、安全设置

    警惕 前一篇文章<Spring+SpringMVC+MyBatis+easyUI整合进阶篇(九)Linux下安装redis及redis的常用命令和操作>主要是一个简单的介绍,针对redis ...

  9. redis的密码设置(windows与linux相同)

    接着我们昨天的说,昨天redis的启动已经了解,今天来说说redis的密码设置.(不管怎么说redis也是数据库,也需要密码) 修改密码可以2种行径.第一种,直接修改配置文件,打开redis.conf ...

随机推荐

  1. javascript获取指定区间范围随机数的方法

    每天学习一点点 编程PDF电子书.视频教程免费下载:http://www.shitanlife.com/code //获取指定区间范围随机数,包括lowerValue和upperValue funct ...

  2. A - Divisors POJ - 2992 (组合数C的因子数)数学—大数

    题意:就是求组合数C的因子的个数! 先说一下自己THL的算法,先把组合数求出来,然后将这个大数分解,得到各个素数的个数,再利用公式!用最快的大数分解算法 分析一下时间复杂度!   n1/4但是分析一下 ...

  3. kumavis/obj-multiplex

    https://github.com/kumavis/obj-multiplex obj-multiplex多路复用 simple stream multiplexing for objectMode ...

  4. PAT A1034 Head of a Gang (30 分)——图遍历DFS,字符串和数字的对应保存

    One way that the police finds the head of a gang is to check people's phone calls. If there is a pho ...

  5. storm集成kafka的应用,从kafka读取,写入kafka

    storm集成kafka的应用,从kafka读取,写入kafka by 小闪电 0前言 storm的主要作用是进行流式的实时计算,对于一直产生的数据流处理是非常迅速的,然而大部分数据并不是均匀的数据流 ...

  6. 动手动脑(lesson2)

    一·随机数生成问题 //信1605-3 20163683 蔡金阳 package lesson2; public class Suiji { private static final int N = ...

  7. Javascript数组Array的forEach方法

    Javascript数组Array的forEach扩展方法 forEach是最常用到的数组扩展方法之一,相当于参数化循环数组,它简单的在数组的每一个元素上应用传入的函数,这也意味着只有存在的元素会被访 ...

  8. Github.Git

    Github介绍:http://www.yangzhiping.com/tech/github.html Git:http://res.crossincode.com/wechat/git.html

  9. 转的一个Java基本功

    京京肚肚撸代码 2017-04-11 00:21 很早之前, 记得一次面试, 面试官问存储金钱用什么数据类型? 当时只知道8种数据类型(boolean, byte, short, int, long, ...

  10. 判断response.data是否为空

    需要对response.data进行判断,是否有数据返回.如果是空的,将要处理一些事情,反之,又要处理另外一些事情. 在jQuery程序中,有一个方法:$.isEmptyObject().此方法在an ...