- yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
- yum install postgresql10
- yum install postgresql10-server
- /usr/pgsql-10/bin/postgresql-10-setup initdb //初始化
- systemctl enable postgresql-10
- systemctl start postgresql-10
- sudo -u postgres psql //进入数据库
- create user username with login password ‘password’; //创建用户
- ALTER USER postgres WITH PASSWORD ‘123456’; //更改密码
- CREATE DATABASE confluence; //创建数据库
- vim /var/lib/pgsql/10/data/postgresql.conf //配置文件,打开远程访问
把 listen_addresses = ‘localhost’ 改为 ‘*’ - vim /var/lib/pgsql/10/data/pg_hba.conf //配置文件,远程权限
80行改为:
host all all 0.0.0.0/0 trust - 重启
- pg_dump confluence -h 127.0.0.1 -U postgres > /data/wiki.sql //备份
- psql confluence -h 127.0.0.1 -U postgres < /data/wiki.sql //还原