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 ...
随机推荐
- springboot 传值到页面
每天学习一点点 编程PDF电子书.视频教程免费下载:http://www.shitanlife.com/code <!DOCTYPE html> 2 <html> 3 &l ...
- Git安装与配置——详细教程1
1.下载Git客户端 想要安装Git首先要下载Git的安装包程序. Git安装包下载地址:https://git-scm.com/downloads/ 2.安装Git 双击安装程序进行安装: a. 欢 ...
- oracle 索引扫描类型的分类与构造
1. INDEX RANGE SCAN--请记住这个INDEX RANGE SCAN扫描方式drop table t purge;create table t as select * from dba ...
- 导入其他python文件或者python文件的函数
from abc import xxx 从abc的py文件导入一个具体的函数或者类 import abc 直接导入文件 a.b写在同一个文件目录下,a要使用b,直接import就可以了
- docker官方文档笔记
Docker在 CentOS7.X上运行.Docker可能在其他EL7的兼容版本中成功安装,但是官方并未进行测试,因此也不提供任何支持. 系统环境要求 docker必须运行在64-bit的系统上,对于 ...
- C++ 实现strcpy
strcpy库函数的原型: // 把src字符串拷贝到dest,并返回dest char *strcpy(char *dest, const char *src) 注意点: 1.形参src用const ...
- linux中断源码分析 - 概述(一)
本文为原创,转载请注明:http://www.cnblogs.com/tolimit/ 关于中断和异常 一般在书中都会把中断和异常一起说明,因为它们具有相同的特点,同时也有不同的地方.在CPU里,中断 ...
- 内核里面writel(readl)是如何实现的
writel和readl,这两个个函数实现在操作系统层,有内存保护的情况下,往一个寄存器或者内存地址写一个数据.先说一下writel: 在arch/alpha/kernel/io.c中有 void ...
- java使用POI读取excel报表
留此作为记录 package com.demo; import java.io.FileInputStream; import java.util.Iterator; import org.apach ...
- Luogu2046 NOI2010 海拔 平面图、最小割、最短路
传送门 首先一个不知道怎么证的结论:任意点的\(H\)只会是\(0\)或\(1\) 那么可以发现原题的本质就是一个最小割,左上角为\(S\),右下角为\(T\),被割开的两个部分就是\(H=0\)与\ ...