麒麟v10 arm架构安装PostgreSQL
PostgreSQL源码下载地址:Index of /pub/source/
安装方法
1、查询麒麟系统版本。
nkvers
返回值
############## Kylin Linux Version #################
Release:
Kylin Linux Advanced Server release V10 (Lance)
Kernel:
4.19.90-52.22.v2207.ky10.aarch64
Build:
Kylin Linux Advanced Server
release V10 (SP3) /(Lance)-aarch64-Build23/20230324
#################################################
2、下载PostgreSQL源码。
curl https://ftp.postgresql.org/pub/source/v16.6/postgresql-16.6.tar.gz -o postgresql-16.6.tar.gz
3、解压PostgreSQL源码压缩包。
postgres]# tar -zvxf postgresql-16.6.tar.gz
4、安装依赖包。
yum install readline.aarch64 readline-devel.aarch64
5、编译并安装PostgreSQL。
cd postgresql-16.6/
./configure --prefix=/opt/postgresql --without-readline
make
make install
6、配置环境变量。
cd /etc/profile.d/
vim postgresql.sh
编辑文件
export PGHOME=/opt/postgresql
export PGDATA=/opt/postgresql/data
export PATH=$PGHOME/bin:$PATH
export LANG=en_US.utf8
export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH
运行文件
source postgresql.sh
7、 创建用户和数据中心。
useradd postgres
mkdir -p /opt/postgresql/data/pgsql
chown postgres:postgres /opt/postgresql/data/pgsql
8、初始化数据库。
su - postgres
/opt/postgresql/bin/initdb -D /opt/postgresql/data/pgsql
9、配置监听的IP地址。
vim /opt/postgresql/data/pgsql/postgresql.conf
找到并修改下面一行:
#listen_addresses = 'localhost'
10、配置允许远程访问。
vim /opt/postgresql/data/pgsql/pg_hba.conf
修改
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
trust表示无密码登录,md5表示使用密码登录。
11、启动数据库。
/opt/postgresql/bin/pg_ctl -D /opt/postgresql/data/pgsql -l logfile start
12、验证5432端口是否开启。
netstat -anp|grep 5432
最后更新于3小时前
本文由人工编写,AI优化,转载请注明原文地址: 麒麟v10 arm架构安装PostgreSQL
推荐阅读
从非交互到交互式备案,手把手教你一周内搞定公安安全评估,轻松解锁网站互动功能
2512026-04-11
CodeBuddyIDE与Trae终极对决:谁是最强国产AI编程IDE?最新版本深度横评
28192025-09-25
XWiki只允许本机访问:Jetty绑定127.0.0.1配置方法
1362026-04-28
VMware Workstation 16激活码及许可证密钥获取方法
29612024-09-29
GeoServer适配达梦数据库完整教程:从账号创建到图层发布
1392026-04-14
Claude Mythos Preview称霸AI编程榜:16项全冠,昂贵且危险的性能怪兽
1832026-04-21