pgsql的10在linux下安装,在 SUSE Linux 上安装 PostgreSQL 10.x

SUSE Linux Enterprise Server 12SP5 (PostgreSQL) 10.12

SUSE Linux Enterprise Server 12SP3 (PostgreSQL) 10.8

linux-137:/usr/local # zypper install postgresql-server postgresql

linux-137:/usr/local # psql --version

psql (PostgreSQL) 10.12

linux-137:/home # chown postgres:postgres ./psqldata/

linux-137:/home # su postgres

postgres@linux-137:/home> initdb -D /home/psqldata/

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 locales

COLLATE:  C

CTYPE:    en_US.UTF-8

MESSAGES: C

MONETARY: C

NUMERIC:  C

TIME:     C

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 /home/psqldata ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting default timezone ... Asia/Shanghai

selecting dynamic shared memory implementation ... posix

creating configuration files ... ok

running bootstrap script ... ok

performing post-bootstrap initialization ... ok

syncing data to disk ... ok

postgres@linux-137:/home> pg_ctl -D /home/psqldata/ start

waiting for server to start....2020-10-13 21:00:44.354 CST   [15250]LOG:  listening on IPv6 address "::1", port 5432

2020-10-13 21:00:44.355 CST   [15250]LOG:  listening on IPv4 address "127.0.0.1", port 5432

2020-10-13 21:00:44.359 CST   [15250]LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2020-10-13 21:00:44.373 CST   [15250]LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"

2020-10-13 21:00:44.387 CST   [15250]LOG:  redirecting log output to logging collector process

2020-10-13 21:00:44.387 CST   [15250]HINT:  Future log output will appear in directory "log".

done

server started

后台运行的命令 postgres -D /usr/local/pgsql/data >logfile 2>&1 &

还是以下命令来的省事

systemctl start postgresql.service

systemctl enable postgresql.service

服务目录:/usr/lib/systemd/system

创建数据库及用户

psql postgres

create user pub password 'test001';

create database pgsql1 owner pub;

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值