开发者社区> 唐修> 正文

PostgreSQL 11源码安装

简介: PostgreSQL 11源码安装 测试环境:RedHat 7.0 Linux 64bit PostgreSQL 11源码安装包下载地址link 系统环境准备 RedHat 7.0默认会安装相关系统包,还需要增加PostgreSQL编译时必须包,如下: gcc, bison, gcc-c++, r.
+关注继续查看

PostgreSQL 11源码安装

测试环境:RedHat 7.0 Linux 64bit

PostgreSQL 11源码安装包下载地址link

系统环境准备

RedHat 7.0默认会安装相关系统包,还需要增加PostgreSQL编译时必须包,如下:

gcc, bison, gcc-c++, readline, readline-devel, zlib, zlib-devel, perl, perl-devel

创建postgres用户,并创建安装目录


useradd Postgres

mkdir -p /opt/pgsql/data
chown -R postgres:postgres /opt/pgsql 

安装PostgreSQL

解压、编译、安装

tar -zxvf postgresql-11.1.tar.gz
cd postgresql-11.1
./configure --prefix=/opt/pgsql
make & make install

初始化数据库

su - postgres

[postgres@postgresql bin]$cd /opt/pgsql/bin
[postgres@postgresql bin]$ ./initdb -D /opt/pgsql/data/
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /opt/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
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:

    ./pg_ctl -D /opt/pgsql/data/ -l logfile start


[postgres@postgresql bin]$./pg_ctl -D /opt/pgsql/data -l logfile start
waiting for server to start.... done
server started

#配置用户环境变量文件.bash.profile增加如下内容
export PATH=$PATH:/opt/pgsql/bin


[postgres@postgresql ~]$ psql
psql (11.1)
Type "help" for help.

postgres=#
postgres=#
postgres=# \du
                                   List of roles
 Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

postgres=#

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
PostgreSQL 10.0 源码安装
源码安装 tar zxvf postgresql-10.0.tar.gz mv postgresql-10.0 /usr/local/pgsql cd /usr/local/pgsql/ root用户下安装依赖包 yum -y install gcc gcc-c++ automake auto...
1534 0
PostgreSQL运维实战精讲之“postgresql源码安装”
一、下载地址 wget https://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.gz 二、安装: #安装依赖包 yum install -y perl-...
769 0
阿里云数据库专家于巍荣获PostgreSQL中国技术大会“最具价值专家 MVP”奖
2023年3月3日,在由PostgreSQL中文社区主办的“第十二届PostgreSQL中国技术大会”上,阿里云数据库开源首席架构师于巍荣获“中国 PostgreSQL 最具价值专家 MVP”奖项。
82 0
喜讯!阿里云数据库PolarDB荣获第12届PostgreSQL中国技术大会“开源数据库杰出贡献奖”
2023年3月3日,由PostgreSQL中文社区主办的“第十二届PostgreSQL中国技术大会”在杭州隆重开幕。本次大会以“突破·进化·共赢 —— 安全可靠,共建与机遇”为主题,邀请了来自国内外的行业专家、企业家代表等,共见创新成果、共论国产数据库发展机遇。会上,PolarDB for PostgreSQL(简称PolarDB-PG )凭借在数据库开源领域的深耕布局和产品技术实力,荣获“开源数据库杰出贡献奖”。
103 0
《RDS数据库入门一本通》电子版地址
本书体系完整,理论充实,内容由浅入深,循序渐进,更配有详细的实例解说,为初学者提供一个完整、严密的思维框架,零基础的你也可轻松掌握RDS数据库的美妙节奏。
19 0
云原生数据库-Amazon RDS
云原生数据库-Amazon RDS
48 0
阿里云rds数据库导出到windows本地数据库中
在搜索框中输入MySQL,然后选中RDS版,进入控制台前首先要关闭数据库连接,否则找不到实例。
29 0
+关注
唐修
ORACLE数据库专家,ADAM产品专家。多年政府、金融领域ORACLE、MySQL、PostgreSQL数据库运维、优化、迁移经验,现于阿里云ADAM产品团队专注企业数据库和应用高效、稳定上云产品研发设计,助力企业IT技术以最小的代价实现业务系统上云。
文章
问答
视频
文章排行榜
最热
最新
相关电子书
更多
云数据库RDS MySQL从入门到高阶
立即下载
PolarDB for PostgreSQL 源码与应用实战
立即下载
PolarDB for PostgreSQL 开源必读手册
立即下载