当前位置:   article > 正文

centos7 安装PostgreSQL_centos postgresql source:not installed

centos postgresql source:not installed

PostgreSQL官网下载地址:https://www.postgresql.org/ftp/source/v10.1/

  • 下载安装包
wget https://ftp.postgresql.org/pub/source/v10.1/postgresql-10.1.tar.gz
  • 1
  • 解压&安装
#创建安装目录和数据目录
mkdir -p /app/soft/postgresql/data
tar -zxvf postgresql-10.1.tar.gz -C /app/soft/

cd /app/soft/postgresql-10.1
./configure  --prefix=/app/soft/postgresql
make && make install 

chown -R postgres.postgres /app/soft/postgresql
su - postgres
#初始化数据库
/app/soft/postgresql/bin/initdb -D /app/soft/postgresql/data/
#启动服务
/app/soft/postgresql/bin/pg_ctl -D /app/soft/postgresql/data/ -l logfile start

#修改密码
/app/soft/postgresql/bin/psql 
ALTER USER postgres WITH PASSWORD '123456';

#修改配置允许远程连接
1.修改data/pg_hba.conf文件中,添加下面的一行
host  all  all  0.0.0.0/0  md5
2.修改postgresql.conf
修改listen_addresses='localhost'为listen_addresses='*'
#重启服务
/app/soft/postgresql/bin/pg_ctl -D /app/soft/postgresql/data/ -l logfile restart
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

在这里插入图片描述

问题解决
  • 1、安装postgreSQL出现错误提示configure: error: readline library not found
yum install readline-devel
  • 1
  • 2、安装postgreSQL出现错误提示 configure: error: zlib library not found
yum install zlib-devel
  • 1

授权表权限

  • 授权指定用户,某个表的查询权限
GRANT SELECT ON table_1 TO zhangsan_ro;
  • 1
  • 授权指定用户,指定schema下所有表的查询权限
GRANT SELECT ON ALL tables IN SCHEMA PUBLIC TO zhangsan_ro;
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/410474
推荐阅读
相关标签
  

闽ICP备14008679号