• [织梦吧]唯一域名:www.dedecms8.com,织梦DedeCMS学习平台.

当前位置: > 系统(os) > linux >

CentOS v6.3 安装PostgreSQL 9(4)

来源: www.dedecms8.com 编辑:织梦吧 时间:2014-07-04点击:

  默认配置中,postgreSQL使用明文存储密码,非常不安全,需要修改配置文件,更改密码验证方式为md5

[root@wardking ~]# vi /var/lib/pgsql/9.1/data/pg_hba.conf
# Put your actual configuration here
# ———————————-
#
# If you want to allow non-local connections, you need to add more
# “host” records.  In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# “local” is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident

  为了使配置文件生效,必须让postgreSQL重新载入配置,有多种方式可以实现:

  第一种方式: 直接使用命令操作

[root@wardking ~]# su – postgres
-bash-4.1$ pg_ctl reload
server signaled
-bash-4.1$

  第二种方式:切换到postgres用户,通过psql命令,调用pg_reload_conf();

-bash-4.1$ psql postgres postgres
psql (9.1.1)
Type “help” for help.
postgres=# select pg_reload_conf();
 pg_reload_conf
—————-
 t
(1 row)
postgres=#

  第三种方式:切换到postgres用户,同样使用psql命令,但无须登录PostgreSQL控制台

猜您也喜欢...

猜你也喜欢看这些...

About D8

  • ©2014 织梦吧(d8) DedeCMS学习交流平台
  • 唯一网址 www.DedeCMS8.com 网站地图
  • 联系我们 1170734538@qq.com ,  QQ