Postgresql 密码设置
今天下午 陷进去了 其实很简单的一个事情结果浪费了 接近一个小时. 做事情必须要细致一些. 自己的确做的不好.
这里面简单说一下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 密码设置的更多相关文章
- 更改MySQL/Postgresql密码
Parrot包括几个SQL引擎,但是当它们被预先安装时,默认密码未被配置,并且拒绝访问其root用户. 重新配置Mysql / Mariadb密码 停止MySQL服务. sudo service my ...
- redis密码设置、访问权限控制等安全设置
redis作为一个高速数据库,在互联网上,必须有对应的安全机制来进行保护,方法有2,如下. 1.比较安全的办法是采用绑定IP的方式来进行控制. 请在redis.conf文件找到如下配置 # If y ...
- GRUB密码设置
通过编辑GRUB启动参数可以轻松的进入单用户模式从而修改root密码,GRUB的密码设置可分为全局密码和菜单密码. 一,全局密码设置 在splashimage这个参数的下一行可以加上passw ...
- Linux - root初始密码设置
Ubuntu刚安装后,不能在terminal中运行su命令,因为root没有默认密码,需要手动设定. 以安装ubuntu时输入的用户名登陆,该用户在admin组中,有权限给root设定密码. 给roo ...
- xampp默认mysql密码设置,修改mysql的默认空密码
xampp默认mysql密码设置,修改mysql的默认空密码 分类: xampp2012-09-12 11:24 30264人阅读 评论(5) 收藏 举报 mysqlphpmyadminauthent ...
- (转)mysql账号权限密码设置方法
原文:http://www.greensoftcode.net/techntxt/2013410134247568042483 mysql账号权限密码设置方法 我的mysql安装在c:\mysql 一 ...
- ubuntu 第一次安装时 默认root 密码设置
Ubuntu刚安装后,不能在terminal中运行su命令,因为root没有默认密码,需要手动设定. 以安装ubuntu时输入的用户名登陆,该用户在admin组中,有权限给root设定密码. 给roo ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(十一)redis密码设置、安全设置
警惕 前一篇文章<Spring+SpringMVC+MyBatis+easyUI整合进阶篇(九)Linux下安装redis及redis的常用命令和操作>主要是一个简单的介绍,针对redis ...
- redis的密码设置(windows与linux相同)
接着我们昨天的说,昨天redis的启动已经了解,今天来说说redis的密码设置.(不管怎么说redis也是数据库,也需要密码) 修改密码可以2种行径.第一种,直接修改配置文件,打开redis.conf ...
随机推荐
- 关于对浏览器发送POST请求的一点研究
网上对与HTTP的Method,GET和POST的区别,说得毕竟详细.然后提到一点,说浏览器对两者的还有一个比较容易让人忽略的区别就是:POST会分2次发送,而GET只1次. GET发送1次,这个没什 ...
- ;,&,&&,shell,区别
command1&command2&command3 三个命令同时执行 command1;command2;command3 不管前面命令执行成功没有,后面的命令继续执 ...
- 最小生成树(图论)--3366lg【模版】
题目描述 如题,给出一个无向图,求出最小生成树,如果该图不连通,则输出orz 输入输出格式 输入格式: 第一行包含两个整数N.M,表示该图共有N个结点和M条无向边.(N<=5000,M<= ...
- 乱入Linux界的我是如何学习的
欢迎来到建哥学Linux,咳!咳!咳!开个玩笑哈,我是一个IT男,IT界的入门选手,正在学习Linux. 在之前,一直想进军IT界,学习IT技术,但是苦于没有人指导,也不知道学什么,最开始我自己在网上 ...
- ztree树形菜单demo
阅读目录 zTree树形菜单 回到顶部 zTree树形菜单 树形菜单使用方式如下:HTML引入的方式如下: <!DOCTYPE html> <html> <head> ...
- Objective-C 浅拷贝与深拷贝
一个Objective-C对象通常分配在堆上,并有一个或者多个指针指向它.如下代码及其关系图所示: NSObject *obj1 = [[NSObject alloc] init]; NSObject ...
- 洛谷 P1525 关押罪犯
题目链接 https://www.luogu.org/problemnew/show/P1525 题目描述 S城现有两座监狱,一共关押着N名罪犯,编号分别为1−N.他们之间的关系自然也极不和谐.很多罪 ...
- linux笔记 - 配置与编译
linux内核下载地址:https://www.kernel.org/ ubuntu下载内核对应源码: sudo apt-get source linux-$(uname -r) #此命令下载的源码存 ...
- SkylineGlobe 从v6.1到v6.5 二次开发方面的变化参考
2.1关于 TerraExplorer v6.5 API 除了一些新的功能,API v6.5不同于API v6.1的最大改进是其对象ID系统.虽然在以前版本的API中,有两个ID系统,一个用于对 ...
- Android popupMenu
popupMenu = new PopupMenu(ActivityHousesNumList.this, imageViewhousesnum1); popupMenu.getMenuInflate ...