标签:
一、PostgreSQL简介
1.3 PostgreSQL应用现状和发展趋势
1 [root@masterdb ~]#yum install -y zlib zlib-devle readline readline-devel python python-devel perl perl-devel bison flex perl-ExtUtils-Embed
可选软件包(lrzsz,sysstat,e4fsprogs,openssl ,openssl-devel ,pam-devel,libxml2-devel,libxslt-devel,tcl-devel,gcc,make,smartmontools,OpenIPMI-tools, systemtap-sdt-devel)
4、安装步骤:
1 [root@masterdb ~]# groupadd postgres 2 [root@masterdb ~]# passwd postgres 3 Changing password for user postgres. 4 New password: 5 BAD PASSWORD: it is too simplistic/systematic 6 BAD PASSWORD: is too simple 7 Retype new password: 8 passwd: all authentication tokens updated successfully. 9 [root@masterdb ~]# tar xf postgresql-9.5.0.tar.gz -C /usr/local/ 10 [root@masterdb ~]# cd /usr/local/postgresql-9.5.0/ 11 [root@masterdb postgresql-9.5.0]# ./configure --prefix=/usr/local/pgsql9.4.5 --with-perl --with-python 12 [root@masterdb postgresql-9.5.0]# make 13 [root@masterdb postgresql-9.5.0]# make install 14 [root@masterdb postgresql-9.5.0]# cd contrib/ #安装额外的管理工具,以便后续管理使用 15 [root@masterdb contrib]# make install 16 [root@masterdb ~]# chown -R postgres.postgres /data/postgredata/ 17 [root@masterdb ~]# chown -R root.postgres /usr/local/pgsql9.4.5
5、配置环境变量:
1 [root@masterdb ~]# vim /etc/profile.d/pgsql.sh 2 export PATH=$PATH:/usr/local/pgsql9.4.5/bin 3 export LD_LIBRARY_PATH=/usr/local/pgsql9.4.5/lib 4 export PGDATA=/data/pgdata 5 [root@masterdb ~]# source /etc/profile.d/pgsql.sh
6、初始化数据库:
1 [root@masterdb ~]# su - postgres 2 [postgres@masterdb ~]$ pg_ctl initdb 3 setting privileges on built-in objects ... ok 4 creating information schema ... ok 5 loading PL/pgSQL server-side language ... ok 6 vacuuming database template1 ... ok 7 copying template1 to template0 ... ok 8 copying template1 to postgres ... ok 9 syncing data to disk ... ok 10 WARNING: enabling "trust" authentication for local connections 11 You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.Success. You can now start the database server using: /usr/local/pgsql9.4.5/bin/pg_ctl -D /data/postgredata -l logfile start 12 [postgres@masterdb ~]$ pg_ctl -D /data/postgredata/ start 13 server starting 14 [postgres@masterdb ~]$ LOG: database system was shut down at 2016-02-01 14:02:16 CST 15 LOG: MultiXact member wraparound protections are now enabled 16 LOG: database system is ready to accept connections 17 LOG: autovacuum launcher started
如果以上没有报错,说明已安装成功。
2.2 Windows上的安装
2、双击下载的postgresql-9.5.0-1-windows-x64.exe文件开始安装
3、单击“Next”继续,选择PostgreSQL软件安装目录,这里我选择安装在D:\Program Files\PostgreSQL\9.5
标签:
原文地址:http://www.cnblogs.com/darren-lee/p/5177480.html