• 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

  • 相关阅读:
    mac安装搜狗
    idea的阿里代码规范检查
    记录windows10闪屏
    github访问不了
    线程安全问题例子
    简单负载均衡工具类
    git将远程分支回归到指定版本
    minio的使用
    php禁止浏览器使用缓存页面的方法
    百度seo
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/5462669.html
Copyright © 2020-2023  润新知