zoukankan      html  css  js  c++  java
  • 在 CentOS 7 1801 中安装 PostgreSQL-11

    官网:https://www.postgresql.org
    下载页面:https://www.postgresql.org/download/
    Red Hat家族Linux(包括CentOS/Fedora/Scientific/Oracle)下载页面:https://www.postgresql.org/download/linux/redhat/
    选择你需要的版本,安装运行命令都在本网页内:

    命令如下:
    yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
    yum -y install postgresql11
    yum -y install postgresql11-server
    /usr/pgsql-11/bin/postgresql-11-setup initdb
    systemctl enable postgresql-11
    systemctl start postgresql-11
    开通PostgreSQL端口:
    firewall-cmd --zone=public --add-port=5432/tcp --permanent
    firewall-cmd --reload
    firewall-cmd --list-ports
    密码:
    [root@CentOS-1804-MySQL-4 ~]# su - postgres
    -bash-4.2$ psql -U postgres
    psql (11.0)
    Type "help" for help.
     
    postgres=# ALTER USER postgres with encrypted password 'postgres';
    ALTER ROLE
    postgres=# q
    -bash-4.2$ exit
    logout
    远程访问:
    vim /var/lib/pgsql/11/data/postgresql.conf
    找到listen_addresses修改为:
    listen_addresses = '*'
    要监听的IP地址;以逗号分隔的地址列表;默认为'localhost';对所有人使用'*'。
     
    编辑:
    vim /var/lib/pgsql/11/data/pg_hba.conf
    新增host    all             all             0.0.0.0/0               md5,如下:
    host    all             all             0.0.0.0/0               md5
    重启数据库:
    systemctl restart postgresql-11
    测试效果:

  • 相关阅读:
    OSCache使用指南
    sql性能优化浅谈
    Oracle SQL性能优化
    SQL性能优化
    Linux/Unix笔记本
    Linux/Unix笔记本
    LUOGU P3413 SAC#1
    poj 2393 Yogurt factory(贪心)
    poj 2431 Expedition (贪心)
    LUOGU P3161 [CQOI2012]模拟工厂 (贪心)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317426.html
Copyright © 2011-2022 走看看