• ubuntu16.04下安装postgres


    原博客地址:https://blog.csdn.net/weixin_44313745/article/details/93464298

        1、安装postgreSQL

    sudo apt-get update
    sudo apt-get install postgresql-9.5

        1
        2

        2、修改数据库用户连接的密码为123456

    sudo -u postgres psql
    postgres=# alter user postgres with password '123456';
    postgres=# q

        1
        2
        3

        3、创建新用户 newuser

    postgres=# create database 'newuser' with password '111111';

        1

        4、创建数据库,并制定所有者

    postgres=# create database 'testdb' with owner = 'newuser';

        1

        5、修改数据库配置实现远程访问

    sudo vim /etc/postgresql/9.5/main/postgresql.conf
    1、在监听任何地址访问,修改连接权限
    # listen_addresses = 'localhost' 改为 listen_addresses='*"
    2.启用密码验证
    #password_encryption = on 改为 password_encryption = on
    -----------------------------------------------------------------------------------
    sudo vim /etc/postgresql/9.5/main/pg_hba.conf
    在文档末尾加上一下内容:
    host all all 0.0.0.0 0.0.0.0 md5

        1
        2
        3
        4
        5
        6
        7
        8
        9

        6、重启服务

    /etc/init.d/postgresql restart

  • 相关阅读:
    我用自己做的图书比价搜索买了一本书
    2.17
    最近的工作
    FireBug的Bug
    2.18
    tecent面试题解答
    .net杂记
    python的round测试
    最近在网上买书的体会
    关于迅雷评论的一个改造html css
  • 原文地址:https://www.cnblogs.com/spqin/p/13256012.html
Copyright © 2020-2023  润新知