zoukankan      html  css  js  c++  java
  • CentOS下PostgreSQL的安装与配置

    一、CentOS下PostgreSQL的yum安装:

    1 #安装yum源,默认源存在对版本的支持不好,下载不到等等问题。
    2 yum install http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
    3 #安装 postgresql95-server 和 postgresql95-contrib
    4 yum install postgresql95-server postgresql95-contrib
    5 #初始化数据库
    6 /usr/pgsql-9.5/bin/postgresql95-setup initdb
    7 #备注:所有可执行文件在/usr/pgsql-9.x/bin/目录下

    二、配置文件:

    1 #配置一般都在/var/lib/pgsql/9.5/pg_hba.conf和/var/lib/pgsql/9.5/postgresql.conf
    2 #修改密码认证支持(pg_hba.conf)
    3 # IPv4 local connections:
    4 host    all             all         0.0.0.0/0               md5
    5 #修改连接IP支持(postgresql.conf)
    6 listen_addresses = 'localhost'  为  listen_addresses='*'
    7 
    8 #修改用户名密码:
    9 sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"

    三、启动服务:

    1 #启动服务
    2 systemctl start postgresql-9.5.service
    3 #服务重启
    4 systemctl restart postgresql-9.5.service
    5 #开机自启
    6 systemctl enable postgresql-9.5.service
  • 相关阅读:
    26.angularJS $routeProvider
    25.内置API
    24.路由
    iOS开发网络篇—数据安全
    从idea到ipo
    CentOS下php安装mcrypt扩展
    iOS客户端学习之AES加密
    PHP 标准AES加密算法类
    使用php扩展mcrypt实现AES加密
    base64的作用
  • 原文地址:https://www.cnblogs.com/KevinGeorge/p/7884039.html
Copyright © 2011-2022 走看看