centos7上安装postgresql11 Beta2版

1.下载安装包

https://ftp.postgresql.org/pub/source/v11beta2/postgresql-11beta2.tar.gz

2.解压编译

tar -zxvf postgresql-11beta2.tar.gz

configure

make

make install

3.生成postgres组和用户

[root@localhost usr]# groupadd postgres
[root@localhost usr]# useradd -g postgres postgres
[root@localhost usr]# passwd postgres

4.建立数据文件目录

root@localhost bin]# mkdir /usr/pgdata
[root@localhost bin]# chown -R postgres:postgres /usr/pgdata
[root@localhost bin]# chmod 700 /usr/pgdata

5.初始化数据库

[postgres@localhost bin]$ ./initdb -D /usr/pgdata/
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 /usr/pgdata … 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 /usr/pgdata/ -l logfile start

6.修改配置文件

vim postgresql.conf

listen_addresses = ‘*’

port = 5432

7.启动数据库

[postgres@localhost bin]$ ./pg_ctl start -D /usr/pgdata/
waiting for server to start…2018-08-07 10:18:44.704 CST [15690] LOG: listening on IPv4 address “0.0.0.0”, port 5432
2018-08-07 10:18:44.704 CST [15690] LOG: listening on IPv6 address “::”, port 5432
2018-08-07 10:18:44.707 CST [15690] LOG: listening on Unix socket “/tmp/.s.PGSQL.5432”
2018-08-07 10:18:44.869 CST [15700] LOG: database system was shut down at 2018-08-07 10:14:35 CST
2018-08-07 10:18:44.903 CST [15690] LOG: database system is ready to accept connections
done
server started
[postgres@localhost bin]$

8.验证

[postgres@localhost bin]$ ./psql
psql (11beta2)
Type “help” for help.

postgres=# select version();
version

PostgreSQL 11beta2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
(1 row)

postgres=#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值