赞
踩
创建文件 :psql_install.sh
#!/bin/bash
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql13-server
/usr/pgsql-13/bin/postgresql-13-setup initdb
systemctl enable postgresql-13
systemctl start postgresql-13
运行安装脚本
bash psql_install.sh
su - postgres
进入sql命令行
psql
create user admin with password '123456' SUPERUSER;
create database testdb;
修改本地配置文件:
/var/lib/pgsql/13/data/pg_hba.conf
...
host all all 0.0.0.0/0 password
/var/lib/pgsql/13/data/postgresql.conf
...
listen_addresses = '*'
重启postgresql
systemctl restart postgresql-13
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。