ubuntu16.0.4 安装postgreSQL

阅读更多

ubuntu 安装postgresQL

 

安装

(1)sudo apt-get install postgresql pgadmin3

 

修改密码   安装好之后会有一个默认的postgres的用户

(2)sudo -u postgres psql template1

 

(3)ALTER USER postgres with encrypted password 'a';

设置好密码   退出

重启

(4)sudo systemctl restart postgresql.service

 

 

接下来需要修改两个配置文件

cd /etc/postgresql/9.5/main



 修改
pg_hba.conf文件

0.0.0.0/0  md5



ubuntu16.0.4 安装postgreSQL_第1张图片
   然后修改文件postgresql.conf


ubuntu16.0.4 安装postgreSQL_第2张图片
 

修改完这两个文件 就可以允许远程访问了

 然后重启 postgresql

sudo /etc/init.d/postgresql restart

 

完成了安装配置
 

 

 

 

 

  • ubuntu16.0.4 安装postgreSQL_第3张图片
  • 大小: 1.9 KB
  • ubuntu16.0.4 安装postgreSQL_第4张图片
  • 大小: 16 KB
  • ubuntu16.0.4 安装postgreSQL_第5张图片
  • 大小: 13.8 KB
  • 查看图片附件

你可能感兴趣的:(ubuntu,postgresql)