赞
踩
wget https://ftp.postgresql.org/pub/source/v10.1/postgresql-10.1.tar.gz
#创建安装目录和数据目录 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
configure: error: readline library not found
yum install readline-devel
configure: error: zlib library not found
yum install zlib-devel
GRANT SELECT ON table_1 TO zhangsan_ro;
GRANT SELECT ON ALL tables IN SCHEMA PUBLIC TO zhangsan_ro;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。