zoukankan      html  css  js  c++  java
  • postgresql安装

    1. 下载postgresql二进制包
     wget https://get.enterprisedb.com/postgresql/postgresql-9.5.6-1-linux-x64-binaries.tar.gz

    2. 安装
      2.1 解压
         tar xf postgresql-9.5.6-1-linux-x64-binaries.tar.gz -C /usr/local/

      2.2 用户、目录和环境变量准备
         useradd postgres
         mkdir -p /data/postgresql/{data,log}
         chown -R postgres.postgres  /data/postgresql/
         vi /home/postgres/.bash_profile
            export PGHOME=/tmp/pgsql
        export PGDATA=/data/pgsql/data
        PATH=$PATH:$HOME/bin:$PGHOME/bin


      2.3 初始化数据库
         cd /usr/local/pgsql/bin
         su postgres
         ./initdb -E utf8 -D /data/postgresql/data/

      2.4 启动
          到postgresql源码包的contribstart-scripts目录下找到linux
          cp linux /etc/init.d/postgresql
          chmod +x /etc/init.d/postgresql
          vi /etc/init.d/postgresql
             prefix=/usr/local/pgsql
             PGDATA="/data/postgresql/data"
             PGLOG="/data/postgresql/log/serverlog"
          service postgresql start
          ps aux |grep post
          lsof -i:5432
          chkconfig --add postgresql

      2.5 登陆测试
          ./psql -d postgres -U postgres














  • 相关阅读:
    uva-10160-枚举
    zk-systemd
    c++官方文档-枚举-联合体-结构体-typedef-using
    c++官方文档-动态内存
    c++官方文档-指针
    c++官方文档-命名空间
    c++官方文档-模版函数和重载
    c++官方文档-按值传递和按引用传递
    c++官方文档
    HDU 1068
  • 原文地址:https://www.cnblogs.com/zhaojonjon/p/6651300.html
Copyright © 2011-2022 走看看