[原]Postgresql 12 Centos8 一键配置脚本
#!/bin/bash echo "write repo" sudo cat>/etc/yum.repos.d/pgdg-redhat-12.repo<<EOF [pgdg12] name=pgdg12 baseurl=https://mirrors.cnnic.cn/postgresql/repos/yum/12/redhat/rhel-8-x86_64/ enabled=1 gpgcheck=0 EOF echo "install postgresql12" sudo dnf install postgresql12-server -y --disablerepo=BaseOS --disablerepo=AppStream echo "postgresql initdb" sudo /usr/pgsql-12/bin/postgresql-12-setup initdb echo "postgresql start" sudo systemctl enable --now postgresql-12 echo "postgresql add firewall" sudo firewall-cmd --add-service=postgresql --permanent sudo firewall-cmd --reload echo "postgresql password postgres" sudo su - postgres <<<"psql -c \"alter user postgres with password ‘postgres‘\"" echo "postgresql bind *" sudo su - postgres <<<"sed -i ‘s/‘\"#listen_addresses = ‘localhost‘\"/\"listen_addresses = ‘*‘ \"‘/g‘ /var/lib/pgsql/12/data/postgresql.conf" echo "postgresql allow 0.0.0.0/0" sudo su - postgres <<<"echo \"host all all 0.0.0.0/0 md5\">>/var/lib/pgsql/12/data/pg_hba.conf" echo "postgresql restart" sudo systemctl restart postgresql-12
相关推荐
83911930 2020-07-28
WanKaShing 2020-11-12
zhbvictor 2020-10-29
kls00 2020-10-15
89921334 2020-07-29
89407707 2020-06-27
89921334 2020-06-26
89244553 2020-06-21
84593973 2020-06-21
83911930 2020-06-16
yaoding 2020-06-14
89244553 2020-06-11
89407707 2020-06-11
89921334 2020-06-10
89407707 2020-06-10
goodriver 2020-06-09
kevinli 2020-06-06
84593973 2020-06-05