zoukankan      html  css  js  c++  java
  • CentOS7通过yum安装postgreSQL

    选择正确的YUM安装源

    yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
    

    安装postgreSQL12

    yum install postgresql12-contrib postgresql12-server –y
    

    安装初始化

    /usr/pgsql-12/bin/postgresql-12-setup initdb
    

    切换postgres用户,并修改postgres用户的连接密码

    su postgres 
    psql
    ALTER USER postgres WITH PASSWORD 'postgres';
    q
    

    配置数据库远程连接信任(由于默认配置不支持密码认证,仅可供本地服务器访问,所以需要进行相关配置)

    vi /var/lib/pgsql/12/data/pg_hba.conf
    
    local   all  all    md5    
    host all all 0.0.0.0/0 md5
    

    开启远程访问

    vi /var/lib/pgsql/12/data/postgresql.conf
    
    listen_addresses = '*'
    

    重启数据库服务

    systemctl restart postgresql-12
    
  • 相关阅读:
    HUST 1017 Exact cover (Dancing links)
    HDU 1160 FatMouse's Speed (DP)
    HDU 1058 Humble Numbers (DP)
    Kubernetes(k8s)
    linux命令
    入侵检测系统
    lynis检测
    CPU死锁
    检测工具lynis
    Linux表面工作
  • 原文地址:https://www.cnblogs.com/MartyCode/p/14149354.html
Copyright © 2011-2022 走看看