zoukankan      html  css  js  c++  java
  • CentOS7 PostgreSQL 安装

    PostgreSQL安装

    安装
    使用yum安装 (找源 http://yum.postgresql.org/)

    yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
    yum install postgresql95-server postgresql95-contrib

    yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm

    yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm

    初始化数据库
    /usr/pgsql-9.5/bin/postgresql95-setup initdb

    启动服务

    systemctl start postgresql-9.5.service

    systemctl status postgresql-9.5.service

    设置开机启动 (centos 服务安装位置 cd /usr/lib/systemd/system/*.service)

    systemctl enable postgresql-9.5.service

    开启远程访问
    /var/lib/pgsql/9.5/data/postgresql.conf

    listen_addresses ='*'
    /var/lib/pgsql/9.5/data/pg_hba.conf

    # IPv4 local connections:
    host all all 127.0.0.1/32 trust
    host all all 192.168.117.1/32 trust
    # IPv6 local connections:
    host all all ::1/128 trust


    修改用户密码

    su postgres
    psql -U postgres
    ALTER USER postgres WITH PASSWORD 'postgres'
    q

  • 相关阅读:
    HDU 1269 迷宫城堡
    HDU 4771 Stealing Harry Potter's Precious
    HDU 4772 Zhuge Liang's Password
    HDU 1690 Bus System
    HDU 2112 HDU Today
    HDU 1385 Minimum Transport Cost
    HDU 1596 find the safest road
    HDU 2680 Choose the best route
    HDU 2066 一个人的旅行
    AssetBundle管理机制(下)
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/5462669.html
Copyright © 2011-2022 走看看