Ubuntu18.04安装postgresql-10

Ubuntu18安装postgresql-10

最近切换Ubuntu作为办公系统,所有软件安装都要重来一遍。

官方文档: https://www.postgresql.org/download/linux/ubuntu/

查看系统版本

~  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:    18.04
Codename:   bionic

我的系统是 bionic, 其他还有xenial(16), trusty(14).

创建resource源

vim /etc/apt/sources.list.d/pgdg.list 

deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main

导入key

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

可以安装以下软件
| name | desc |
| ---- | ----|
|postgresql-client-10 | client libraries and client binaries |
|postgresql-10 | core database server |
|postgresql-contrib-9.x | additional supplied modules (part of the postgresql-xx package in version 10 and later) |
|libpq-dev | libraries and headers for C language frontend development |
|postgresql-server-dev-10| libraries and headers for C language backend development |
|pgadmin4 | pgAdmin 4 graphical administration utility |

安装

sudo apt-get install postgresql-10  pgadmin4

安装之后

安装完毕已经启动,可以修改下密码:

sudo su postgres
ALTER USER postgres WITH PASSWORD '新密码'; 

安装完的目录: /var/lib/postgresql/10

然后其他配置类似centos7: https://www.cnblogs.com/woshimrf/p/centos-install-postgresql.html

启动pgadmin

Ubuntu上navicate貌似不好装,使用官方pgadmin4

sudo find / -name pgAdmin4

## 启动
pgAdmin4

转载于:https://www.cnblogs.com/woshimrf/p/ubuntu-install-postgresql10.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值