码迷,mamicode.com
首页 > 数据库 > 详细

安装配置Postgresql

时间:2016-08-30 13:41:08      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:

//关闭selinux
getenforce
setenfroce 0
vi /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
//关闭防火墙
#chkconfig iptables off
#service iptables stop

//安装PGSQL
# rpm --force -ivh openssl-1.0.1e-42.el6.x86_64.rpm postgresql94-libs-9.4.6-1PGDG.rhel6.x86_64.rpm postgresql94-9.4.6-1PGDG.rhel6.x86_64.rpm postgresql94-server-9.4.6-1PGDG.rhel6.x86_64.rpm postgresql94-contrib-9.4.6-1PGDG.rhel6.x86_64.rpm
#sudo rpm -aq| grep postgres
#sudo service postgresql-9.4 initdb
#sudo service postgresql-9.4 start
#sudo chkconfig postgresql-9.4 on

//pgsql 配置
# nano /var/lib/pgsql/9.4/data/postgresql.conf
修改下列两个参数:
listen_addresses = ‘*‘
port = 5432
# nano /var/lib/pgsql/9.4/data/pg_hba.conf
修改参数如下:
# IPv4 local connections:
host all all 127.0.0.1/32 trust

重新加载配置文件并重启数据库:
#/etc/init.d/postgresql-9.4 reload
#service postgresql-9.4 restart

#su – postgres
psql
alter user postgres with password ‘123456‘;
create user sample with password ‘123456‘;
create database sample;

 

安装配置Postgresql

标签:

原文地址:http://www.cnblogs.com/Tiago/p/5821614.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!