Created
March 30, 2018 19:25
-
-
Save kenmazaika/42e139f2fb420d833c4bb9d2e32e9da0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install -y postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs | |
sudo service postgresql initdb | |
sudo mv /var/lib/pgsql9/data/postgresql.conf /var/lib/pgsql9/data/postgresql-old.conf | |
sudo curl -o /var/lib/pgsql9/data/postgresql.conf https://gist.githubusercontent.com/kenmazaika/1beee173b4b9172c27b165a722edb849/raw/7bf8880d9ae32e80c08f79a22713b5c68b1ddece/postgres.conf | |
sudo mv /var/lib/pgsql9/data/pg_hba.conf /var/lib/pgsql9/data/pg_hba-old.conf | |
sudo curl -o /var/lib/pgsql9/data/pg_hba.conf https://gist.githubusercontent.com/kenmazaika/3c14af3e78f12be2bc11d806e2a2f0ec/raw/32eef13ac302e6d10158a18f8d13d0e6120b19c2/pg_hba.conf | |
sudo service postgresql restart | |
sudo sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';" | |
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';" | |
sudo sudo -u postgres psql -c "DROP DATABASE template1;" | |
sudo sudo -u postgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';" | |
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment