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














  • 相关阅读:
    JSON和JSONP
    微信问题汇总
    Linux 技巧:让进程在后台可靠运行的几种方法
    redis笔记
    php安装
    数据库分享一: MySQL的Innodb缓存相关优化
    nginx是以多进程的方式来工作的
    运行和控制Nginx
    nginx安装
    Redis监控技巧总结
  • 原文地址:https://www.cnblogs.com/zhaojonjon/p/6651300.html
Copyright © 2011-2022 走看看