postgresql 9源码安装
安装文档1:
[root@node2 pg952]# tar -jxvf postgresql-9.5.2.tar.bz2 [root@node2 pg952]# cd postgresql-9.5.2 [root@node2 pg952]# cat INSTALL |more [root@node2 pg952]# mkdir /pg952 [root@node2 pg952]# ./configure --prefix=/pg952/ [root@node2 pg952]# gmake world [root@node2 pg952]# gmake install-world [root@node2 pg952]# id postgres [root@node2 pg952]# chown -R postgres:postgres /pg952/ [root@node2 pg952]# initdb -D /usr/local/pgsql/data/ --locale=C --encoding=UTF8 [root@node2 pg952]# pg_ctl start -l logfile |
安装文档2:
linux系统依赖包: [root@localhost ~]# gcc --version gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@localhost ~]# make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for x86_64-redhat-linux-gnu [root@localhost ~]# rpm -qa|grep readline compat-readline5-5.2-17.1.el6.x86_64 readline-devel-6.0-4.el6.x86_64 readline-6.0-4.el6.x86_64 [root@localhost ~]# rpm -qa|grep zlib zlib-1.2.3-29.el6.x86_64 zlib-devel-1.2.3-29.el6.x86_64 安装postgresql 5.2 [root@localhost mnt]# tar -jxvf postgresql-9.5.2.tar.bz2 [root@localhost mnt]# cd postgresql-9.5.2 [root@localhost postgresql-9.5.2]# ./configure --prefix=/pg952/ [root@localhost postgresql-9.5.2]# make world [root@localhost postgresql-9.5.2]# make install-world [root@localhost pg952]# cd /pg952/ [root@localhost pg952]# ll 总计 32 drwxr-xr-x 2 root root 4096 05-26 05:41 bin drwxr-xr-x 4 root root 4096 05-26 05:40 include drwxr-xr-x 4 root root 4096 05-26 05:40 lib drwxr-xr-x 5 root root 4096 05-26 05:40 share [root@localhost pg952]# id postgres uid=26(postgres) gid=26(postgres) groups=26(postgres) context=root:system_r:unconfined_t:SystemLow-SystemHigh [root@localhost pg952]# chown -R postgres:postgres /pg952/ [root@localhost pg952]# ll /pg952/ 总计 32 drwxr-xr-x 2 postgres postgres 4096 05-26 05:41 bin drwxr-xr-x 4 postgres postgres 4096 05-26 05:40 include drwxr-xr-x 4 postgres postgres 4096 05-26 05:40 lib drwxr-xr-x 5 postgres postgres 4096 05-26 05:40 share [root@localhost pg952]# su - postgres -bash-3.2$ vim .bash_profile --添加如下环境变量 [ -f /etc/profile ] && source /etc/profile export PGHOME=/pg952 export PGDATA=/pg952/data export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH PATH=$PGHOME/bin:$PATH -bash-3.2$ pg_ctl init --初始化数据库 -bash-3.2$ vim postgresql.conf --修改配置文件 #listen_addresses = 'localhost' # what IP address(es) to listen on; listen_addresses = '*' -bash-3.2$ vim pg_hba.conf --修改配置文件 # IPv4 local connections: host all all 127.0.0.1/32 trust host all all 192.168.72.0/24 md5 -bash-3.2$ pg_ctl start -l $PGHOME/logfile 2>&1 >/dev/null --启动数据库 注意:pg_ctl start|status|stop|restart进行数据库启动 -bash-3.2$ ps -ef|grep post --查看数据库状态 -bash-3.2$ cat logfile -bash-3.2$ ps -f -U postgres 连接数据库: -bash-3.2$ psql --本地连接 psql (9.5.2) Type "help" for help. postgres=# \l .......... postgres-# \password --修改pg口令 Enter new password: Enter it again: C:\Users\wangwc>psql -h 192.168.72.130 -U postgres -d oracle --远程连接 |
Postgresql shared memory usage:
|
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了