postgres8.4安装配置:
1.安装postgres8.4
~$ sudo apt-get install postgresql

2.修改超级管理员postgres密码:
以系统用户运行psql
~$ sudo -u postgres psql postgres
修改postgres密码(123456)
postgres=# /password postgres

3.备份修改的配置文件:
备份pg_hba.conf文件
~$ sudo cp /etc/postgresql/8.4/main/pg_hba.conf  /etc/postgresql/8.4/main/pg_hba.conf.original
备份postgresql.conf文件
~$ sudo cp /etc/postgresql/8.4/main/postgresql.conf /etc/postgresql/8.4/main/postgresql.conf.original

4.创建测试用户(密码:123456):
建立测试用户 usertest1,usertest2
createuser -A -D -P -R usertest1
createuser -A -D -P -R usertest2

-A 不允许创建其他用户
-D 不允许创建数据库
-P  创建密码
-R  不允许创建角色

5.创建测试数据库:
建立dbtest1 拥有者为usertest1
建立dbtest2 拥有者为usertest2

6.修改配置文件:
修改postgresql.conf
改变行  #listen_addresses = 'localhost'  修改为 listen_addresses = '*'   监听所有端口
改变行  #password_encryption = on        修改为  password_encryption = on  允许密码访问

修改pg_hba.conf
host    all         all         127.0.0.1/32          md5
host    all         all         192.168.10.0/24       md5
host    dbtest1     usertest1     172.18.67.107/32      md5
host    dbtest2     usertest2     172.18.67.109/32      md5

参考文档:

http://wiki.ubuntu.org.cn/PostgreSQL

http://wiki.ubuntu.org.cn/UbuntuHelp:PostgreSQL

http://community.itbbs.cn/topic/7011-postgresql%E5%AE%89%E8%A3%85%E5%92%8C%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/?s=27253e5f5998aa7f7f10e86e74fa6bf2

安装postgresql:

sudo apt-get install postgresql

安装pgAdmin3

sudo apt-get install pgadmin3

启动&关闭:

sudo /etc/init.d/postgresql-8.4 start

sudo /etc/init.d/postgresql-8.4 stop

以系统用户运行psql:

sudo -u postgres psql postgres

设置密码:

/password postgres

创建用户(postgres):

createuser -A -D -P -R user1

-A 不允许创建其他用户

-D 不允许创建数据库

-P  创建密码

-R  不允许创建角色

创建数据库:

sudo -u postgres  createdb mydb

激活数据库:

sudo -u postgres psql mydb

使用pgadmin图形客户端:

在终端中输入:pdadmin3

限制ip访问

限制用户名和数据库

修改配置文件:

配置文件放在:/etc/postgresql/8.4/main

管理用户和权限:

编辑/etc/postgresql/8.4/main/pg_hba.conf 并修改它的默认配置

/etc/postgresql/8.4/main/postgresql

sudo gedit /etc/postgresql/8.4/main/postgresql.conf

改变行:#listen_addresses = ‘localhost’ 修改为:listen_addresses = ‘*’

改变行:#password_encryption = on 修改为:password_encryption = on

参考文档

http://www.pgsqldb.org/pgsqldoc-cvs/client-authentication.html

http://www.linuxsir.org/main/node/254

用psql登录

sudo -u postgres psql -U user1 -d test_user1 -h 192.168.10.251

参考文档:

http://bbs.chinaunix.net/viewthread.php?tid=809390

http://blog.csdn.net/wyswlp/article/details/5723327

Ubuntu下Postgres安装与配置的更多相关文章

  1. [转]:Ubuntu 下Apache安装和配置

    [转]:Ubuntu 下Apache安装和配置_服务器应用_Linux公社-Linux系统门户网站  https://www.linuxidc.com/Linux/2013-06/85827.htm ...

  2. Torch7在Ubuntu下的安装与配置

    Torch7的本系列教程的主要目的是介绍Torch的入门使用.今天首先分享一下Torch7的安装.(在Ubuntu14.04安装torch7) 为什么选择Torch Torch的目标是在建立科学算法的 ...

  3. 【转载】Ubuntu下SVN安装和配置

    一.SVN安装 1.安装包 1.$ sudo apt-get install subversion 2.创建项目目录 $ sudo mkdir /home/xiaozhe/svn $ cd /home ...

  4. Ubuntu下SVN安装和配置

    一.SVN安装 1.安装包 1.$ sudo apt-get install subversion 2.创建项目目录 $ sudo mkdir /home/xiaozhe/svn $ cd /home ...

  5. Ubuntu 下Apache安装和配置

    在Ubuntu上安装Apache,有两种方式:1 使用开发包的打包服务,例如使用apt-get命令:2 从源码构建Apache.本文章将详细描述这两种不同的安装方式. 方法一:使用开发包的打包服务—— ...

  6. MySQL在Win10与Ubuntu下的安装与配置

        本文首发于cartoon的博客     转载请注明出处:https://cartoonyu.github.io/cartoon-blog     近段时间把自己电脑(win).虚拟机(Ubun ...

  7. ubuntu下Pycharm安装及配置

    从知乎里看到了Pycharm的介绍,感觉还不错,记录下今天的安装过程 1.从http://www.jetbrains.com/pycharm/download/下载最新的Pycharm 2.在终端中进 ...

  8. Ubuntu 下Apache安装和配置2

    在Ubuntu上安装Apache,有两种方式:1 使用开发包的打包服务,例如使用apt-get命令:2 从源码构建Apache.本文章将详细描述这两种不同的安装方式. 方法一:使用开发包的打包服务—— ...

  9. eclipse(1)----ubuntu下的安装与配置

    eclipse的安装与配置 1.eclipse官网下载,最新版本eclipse-jee-oxygen-3-linux-gtk-x86_64.tar.gz 2.tar包存在~/Download/下,解压 ...

随机推荐

  1. sqlserver:rank() over()函数

    先前在oracle数据库中接触过over()函数的一系列使用,但是在实际的sql开发中并没有太多的使用,这次在sqlserver的sql拼写中重新遇到这个函数,故结合网上的例子和项目中实际中使用,将其 ...

  2. Android开发--数据存储之File文件存储

    转载来自:http://blog.csdn.net/ahuier/article/details/10364757,并进行扩充 引言:Android开发中的数据存储方式 Android提供了5种方式存 ...

  3. 有关如何线程安全的使用map(hashMap)

    最近在写一个多线程中控制输出顺序的系统中的一个代码,使用了map的数据结构.具体的业务是需要一个单例的对象,然后需要在多线程的环境下实现添加和删除的操作.部分代码如下: public class Up ...

  4. java8--List转为Map、分组、过滤、求和等操作

    利用java8新特性,可以用简洁高效的代码来实现一些数据处理~ 定义1个Apple对象: public class Apple { private Integer id; private String ...

  5. MySQL Bug剖析之Slave节点并行复制死锁

    此文已由作者温正湖授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 有天一早,DBA同学就找上来了,说有个DDB集群下的RDS实例Slave节点(从库)死锁了,请求支援.说实话 ...

  6. E20180603-hm

    breadth  n. 宽度; 宽容; (知识.兴趣等的) 广泛; depth  n. 深度; 深处,深海; 深奥,奥妙; 进深; deep adj. 深的; 深远的,深奥; 重大的,深刻的; 强烈的 ...

  7. JS鼠标响应事件经过、移动、点击示例介绍

    原文: http://www.jb51.net/article/41124.htm onMouseDown 按下鼠标时触发 onMouseOver 鼠标经过时触发 onMouseUp 按下鼠标松开鼠标 ...

  8. 51nod 1049【经典】

    自己模拟,全靠体会~ #include <cstdio> #include <stack> #include <iostream> #include <str ...

  9. ugui mask失效

    android平台 PlayerSettings-Resolution and Presentation-DisableDepth and Stencil这项勾选,mask失效

  10. 51nod1270(dp)

    题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1270 题意:中文题诶- 思路:dp s=abs(a1-a0)+ ...