安装和配置

ubuntu server 已经自动安装了progresql,故安装步骤就省略


  • 初始postgresql没有密码,不能使用,需要先设置密码,命令(从网上随意找的)如下:

    sudo su postgres -c psql template1
    ALTER USER postgres WITH PASSWORD ‘RncRmp2015’;

  • 之后在对postgres用户设置密码,使其可以通过远程登陆

    sudo passwd postgres

  • 创建用户,管理权限

    CREATE USER WebManager WITH CREATEDB CREATEROLE NOSUPERUSER NOINHERIT PASSWORD ‘?????????’;

  • 登陆WebManager用户,其中rmp是数据库,登陆上后可以切换,也可以创建数据库

    psql rmp -U WebManager
    切换数据库命令:\c databasename

遇到的问题:
  • 现象:psql: FATAL: database “” does not exist

    默认使用psql登陆postgresql,使用的是与登陆名相同的数据库
    解决方法:指定数据库,然后登陆,即可

  • 现象:psql: FATAL: Peer authentication failed for user

    数据库的配置 /etc/postgresql/9.3/main/pg_hba.conf 中的 local all postgres peer 中的peer改为md5,使用命令 sudo /etc/init.d/postgresql reload 重新加载一下配置即可

  • 现象:远程无法链接postgresql数据库

    默认postgresql监听的IPV4的地址是:127.0.0.1,没有监听对外的IP地址
    /etc/postgresql/9.3/main/pg_hba.conf的配置修改
    默认的配置为:

    # IPv4 local connections:
    host all all 127.0.0.1/32 md5

    修改为:

    # IPv4 local connections:
    host all all 192.168.0.1/0 md5

    /etc/postgresql/9.3/main/postgresql.conf的配置修改
    默认配置为:

    listen_addresses = 'localhost'         # what IP address(es) to listen on;

    修改为:

    listen_addresses = '*'          # what IP address(es) to listen on;

    重启postgresql服务生效

Postgresql 简单配置 (ubuntu server 14.04.3)的更多相关文章

  1. Ubuntu Server 14.04 & Apache2.4 虚拟主机、模块重写、隐藏入口文件配置

    环境: Ubuntu Server 14.04 , Apache2.4 一.Apache2.4 虚拟主机配置 01. 新建一份配置文件 在apache2.4中,虚拟主机的目录是通过/etc/apach ...

  2. Ubuntu Server 14.04 集成

    方便工作出差显示项目整合了下平时常用软件: OS: Ubuntu Server 14.04 VM:VMware Workstation 12.1.0 (不同版本好像会不兼容) 已经安装软件: 1. s ...

  3. U盘安装ubuntu server 14.04

    U盘安装ubuntu server 14.04 U盘安装ubuntu server 14.04 1.制作启动u盘 2.开始安装 1 将u盘插入主机,重启后从u盘启动 2 选择语言(随便挑,随便选),我 ...

  4. Ubuntu Server 14.04 下root无法ssh登陆

    今天安装了Ubuntu Server 14.04   在终端配置了root密码后,使用SecureCRT和putty竟然不能ssh登陆,SecureCRT一直提示密码不对,但是可以肯定输入的密码100 ...

  5. Ubuntu Server 14.04在VMware安装的一些事儿

    这几天一直在折腾Ubuntu Server 14.04,故记录下: 安装前的准备: 1.建议安装英文版,像15.04.16.04等安装中文版时存在bug,而且中文版字体显示也有问题. 2.Ubuntu ...

  6. Ubuntu Server 14.04 LTS(64bit)已安装 weblogic Server 12c(12.1.3) Zip Distribution

    这里说的对Ubuntu Server 14.04 LTS(64bit)已安装weblogic Server 12c(12.1.3) Zip Distribution遇到的问题.至于Windows什么好 ...

  7. ubuntu server 14.04 上安装jdk1.8

    ubuntu server 14.04 上安装jdk1.8 1.使用apt-get安装oracle-jdk安装oracle jdk sudo apt-get install python-softwa ...

  8. ubuntu server 14.04 LTS下搭建LAMP环境之最详细笔记之一U盘安装双系统

    前言: 一直在WIN上使用PHP,不喜欢用WAMP,每次都是手动在windows配置环境,偶尔有一次装了小红帽玩了两天,感觉不是很习惯就换了回来,过了没几天见讨论LAMP环境,于是安装了ubuntu的 ...

  9. Ubuntu Server 14.04升级Ubuntu Server 16.04

    Ubuntu Server 14.04升级Ubuntu Server 16.04 :转 http://blog.csdn.net/chszs 1.终端下执行命令 $ sudo apt-get upda ...

随机推荐

  1. JSON-RPC 2.0 规范中文文档

    链接地址如下 http://wiki.geekdream.com/Specification/json-rpc_2.0.html

  2. Nginx+PHP On windows

    前期准备 Nginx 下载 http://nginx.org/   PHP下载 PHP Windows binaries       问题 问题1: opened a DOS window to la ...

  3. PHP求职宝典系列——PHP Web 编程篇

    PHP Web 编程篇 form表单 1.简述 POST 和 GET 传输的最大容量分别是多少? GET 方法提交的表单数据被附加到 URL 上,并作为URL 的一部分发送到服务器端. URL 的长度 ...

  4. 1869: Mathematics and Geometry

    这是郑州轻工业学校的一次校赛的校内选拔赛,看名字是计算几何 的题 题目地址: http://acm.zzuli.edu.cn/zzuliacm/problem.php?id=1869 Descript ...

  5. Struts2(Ognl)

    OGNL(Object-Graph Navigation Language)全称为对象图导航语言,是一种功能强大的表达式语言,它通过简单一致的语法,可以任意存取对象的属性或者调用对象的方法,能够遍历整 ...

  6. Referenced file contains errors (http://www.springframework.org/schema...错误

    Referenced file contains errors (http://www.springframework.org/schema...错误 Referenced file contains ...

  7. [LeetCode] Number of Segments in a String 字符串中的分段数量

    Count the number of segments in a string, where a segment is defined to be a contiguous sequence of ...

  8. [LeetCode] Missing Number 丢失的数字

    Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missin ...

  9. Ubuntu apache2.4 设置虚拟主机

    每次重装系统如何配置都上网找,搞半天,都是不对的,还不如自己记下来,以作参考呢.我的项目目录是 /home/feiffy/demo/test,映射的域名是 test.com,这样在浏览器输入 test ...

  10. 通过iMindMap改善你的工作方式的教程

    对于iMindMap 10,已经介绍了很多新增与改进的功能,你以为已经结束了?其实不然,本文,小编还会继续和你分享它的一个新功能与一个更新功能.这两个功能将在不经意间改善你的工作方式. 多媒体支持 在 ...