FreeBSD14编译安装postgresql16

解压

tar -zxvf

安装依赖

pkg install gmake perl5 python libxml2 libxslt ldapsdk openldap26-server openldap26-client ossp-uuid readline p5-Locale-Msgfmt gettext tcl90 tcllib sudo

配置

cd 解压的文件夹

./configure --prefix=/opt/postgresql/16 --exec-prefix=/opt/postgresql/16 --bindir=/opt/postgresql/16/bin --sysconfdir=/opt/postgresql/16/configuration --libdir=/opt/postgresql/16/lib --includedir=/opt/postgresql/16/include --datarootdir=/opt/postgresql/16/dataroot --localedir=/opt/postgresql/16/locale --mandir=/opt/postgresql/16/locale/man --docdir=/opt/postgresql/16/locale/doc --htmldir=/opt/postgresql/16/locale/html --enable-nls='en_US zh_CN' --with-perl --with-python --with-tcl --with-icu --with-openssl --with-ldap --with-pam --with-libxml --with-libxslt --with-readline --with-zlib --without-icu --with-ossp-uuid  --with-includes=/usr/local/include:/usr/src --with-libraries=/usr/local/lib

编译安装

gmake -j32 && gmake install

(contrib文件夹下也编译安装)

用户

adduser postgres

初始化

mkdir /opt/postgresql/16/dbdata/

sudo -u postgres /opt/postgresql/16/bin/initdb -D /opt/postgresql/16/dbdata

文件夹权限

chown -R postgres /opt/postgresql/16/dbdata/

chmod -R 750 /opt/postgresql/16/dbdata/

服务

/etc/rc.d/postgresql

#!/bin/sh

# PROVIDE: postgresql
# REQUIRE: DAEMON mountlate
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable PostgreSQL:
#
#  postgresql_enable="YES"
#  # optional
#  postgresql_data="/var/db/postgres/data16"
#  postgresql_flags="-w -s -m fast"
#  postgresql_initdb_flags="--encoding=utf-8 --lc-collate=C"
#  # leave empty to use the login class set in in /etc/passwd:
#  postgresql_login_class="my_custom_login_class"
#  postgresql_profiles=""
#
# See /usr/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值