美文网首页
PostGis - ubuntu14.04

PostGis - ubuntu14.04

作者: 被扁的橙子 | 来源:发表于2016-12-29 10:58 被阅读0次
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

sudo apt-get install autoconf binutils-doc bison build-essential flex
sudo apt-get install git
sudo apt-get install python-software-properties

sudo add-apt-repository ppa:cartodb/postgresql-9.5 && sudo apt-get update
sudo apt-get install libpq5 \ libpq-dev \ postgresql-client-9.5 \ postgresql-client-common
sudo apt-get install postgresql-9.5 \ postgresql-contrib-9.5 \ postgresql-server-dev-9.5 \ postgresql-plpython-9.5

sudo service postgresql restart

添加用户

sudo adduser dbuser
sudo su - postgres
psql

\password postgres

CREATE USER dbuser WITH PASSWORD 'password';
CREATE DATABASE exampledb OWNER dbuser;
GRANT ALL PRIVILEGES ON DATABASE exampledb to dbuser;
\q

远程连接
vi /etc/postgresql/9.5/main/postgresql.conf
修改 #listen_addresses=’localhost’
listen_addresses=’*’

vi /etc/postgresql/9.5/main/pg_hba.conf
添加host all all 0.0.0.0/0 md5

相关文章

网友评论

      本文标题:PostGis - ubuntu14.04

      本文链接:https://www.haomeiwen.com/subject/xcwuvttx.html