Deepin安装postgres10

Deepin安装postgres10

POSTGRES.png

创建文件/etc/apt/sources.list.d/pgdg.list,并为存储库添加一行

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

导入存储库签名密钥,并更新包列表:

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

sudo apt-get install postgresql-10  # 安装postgres10

启动postgresql

systemctl start  postgresql.service

查看服务运行情况

systemctl status postgresql.service

重置超级管理密码

sudo su - postgres -c psql

postgres=# alter user postgres with password 'new-password';

# 查看用户
\du
# 退出
\q
# 帮助
\?

开启外部访问

sudo find / -name pg_hba.conf
sudo echo "host    odoo    all    0.0.0.0/0    md5" >> /etc/postgresql/10/main/pg_hba.conf
Last modification:August 5th, 2019 at 09:44 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment