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

这里面简单说一下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. Python高级网络编程系列之终极篇---自己实现一个Web框架

    通过前面几个小节的学习,现在我们想要把之前学到的知识点给串联起来,实现一个很小型的Web框架.虽然很小,但是用到的知识点都是比较多的.如Socket编程,装饰器传参在实际项目中如何使用.通过这一节的学 ...

  2. 从Excel表导入数据到Table

    步骤: 1.写第一行SQL,(本sql对应的是oracle数据库) ="INSERT INTO TD_PROMOTION_RATE VALUES("&A3&&quo ...

  3. Ubuntu16.04下安装配置phpmyadmin

    在项目配置了阿里的druid,可以监控session,spring和详细sql的执行情况以及具体到表等信息,但是仍然发现不够详细,而且作为一个半吊子dba,一直用linux命令分配权限和管理数据库,效 ...

  4. sql截取日期/时间的单独部分,比如年、月、日、小时、分钟等等

    可以使用EXTRACT() 函数.(oracle和mysql都有该函数) 语法: EXTRACT(unit FROM date) date 参数是合法的日期表达式.unit 参数可以是下列的值:YEA ...

  5. webpack4+node合并资源请求, 实现combo功能(二十三)

    本文学习使用nodejs实现css或js资源文件的合并请求功能,我们都知道在一个复杂的项目当中,可能会使用到很多第三方插件,虽然目前使用vue开发系统或者h5页面,vue组件够用,但是有的项目中会使用 ...

  6. 【Codeforces 526D】Om Nom and Necklace

    Codeforces 526 D 题意:给一个字符串,求每个前缀是否能表示成\(A+B+A+B+\dots+A\)(\(k\)个\(A+B\))的形式. 思路1:求出所有前缀的哈希值,以便求每个子串的 ...

  7. java Switch中的case后面加上大括号({})和不加大括号的区别

    java基础求真之switch 的case 后面加上大括号和不加大括号的区别. 下面给出三段代码大家看一下有什么不同以及哪段代码能够编译通过那段代码编译不能通过,为什么?(Why?) 代码片段一: i ...

  8. co模块源码学习笔记

    // Sorrow.X --- 添加注释,注释纯属个人理解 /** * slice变量 引用 数组的 slice方法 */ var slice = Array.prototype.slice; /** ...

  9. date日期 格式化

    这个是别人写的,我拿过来用的,哈哈 Date.prototype.format = function(fmt) { var o = { "M+" : this.getMonth() ...

  10. (转)用graph-easy描绘kubenetes描绘k8s组件逻辑图

    1.参考: https://xuxinkun.github.io/2018/09/03/graph-easy/ http://bloodgate.com/perl/graph/manual/faq.h ...