|
linux服务器安装PGSQL11步骤 二维码
1921
发表时间:2019-01-16 15:19 1. Open https://www.postgresql.org/download/linux/redhat/ 2. Select version: 3. Select platform: 4. Select architecture: 5. Install the repository RPM: yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm 6. Optionally install the server packages: yum install postgresql11-server 7. 初始化数据库,开机启动: /usr/pgsql-11/bin/postgresql-11-setup initdb systemctl enable postgresql-11 systemctl start postgresql-11 8. 开启访问权限: 默认会安装在 /usr/pgsql-11/ 数据文件会存在 /var/lib/pgsql/11/data vim postgresql.comf listen_addresses = '*' ===================================== /var/lib/pgsql/11/data/pg_hba.conf # IPv4 local connections: host all all xxx.xxx.xxx.xxx/32 md5 host all all */32 md5 9. 修改数据库密码: sudo -u postgres psql ALTER USER postgers WITH PASSWORD 'lxx' 退到根目录下,执行上述指令,否则密码修改不成功 10. 重启数据库 systemctl restart postgresql-11 11. 查看pgsql进程: ps -ef | grep postgres |