安装和配置

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. Nginx模块之http.md

    ngx_http_access_module ngx_http_access_module模块允许限制对某些客户端地址的访问. 访问也可以通过密码,子请求的结果或JWT来限制. 通过地址和密码的同时访 ...

  2. C#/ASP.NET定时任务执行管理器组件–FluentScheduler定时器

    必须JobManager初始化 方式1: public void Start()         {             JobManager.AddJob(() => FetchingDa ...

  3. redis3.0常用命令

    1.服务器启动 1)快捷启动 $redis-server 2)指定配置文件启动 $redis-server redis.conf 2.客服端启动 1)快捷无密码启动 $redis-cli 2)有密码和 ...

  4. html之select标签

    循环select标签 <select name="group_id"> {% for row in group_list %} <option value={{r ...

  5. [LeetCode] Second Highest Salary 第二高薪水

    Write a SQL query to get the second highest salary from the Employee table. +----+--------+ | Id | S ...

  6. [LeetCode] Plus One 加一运算

    Given a non-negative number represented as an array of digits, plus one to the number. The digits ar ...

  7. Android/Linux下CGroup框架分析及其使用

    1 cgroup介绍 CGroup是control group的简称,它为Linux kernel提供一种任务聚集和划分的机制,可以限制.记录.隔离进程组(process groups)所使用的资源( ...

  8. Js数组

    参考:http://www.w3school.com.cn/jsref/jsref_obj_array.asp 一.数组定义 1.  var arr= [1,2,3]; 2.  var arr= ne ...

  9. iOS-绘图

    0 CGContextRef context = UIGraphicsGetCurrentCont ext(); 设置上下文  1 CGContextMoveToPoint 开始画线  2 CGCon ...

  10. 实例解析防抖动(Debouncing)和节流阀(Throttling)

    http://outofmemory.cn/javascript/js-Debounce-throttle