Last active
June 6, 2018 20:10
-
-
Save di3goleite/e714a2296025328a979a to your computer and use it in GitHub Desktop.
PostgreSQL on openSUSE 13.2
This file contains 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
# install latest postgresql | |
sudo yum install postgresql-server postgresql-contrib | |
# start postgresql | |
sudo systemctl start postgresql | |
# change postgres user password | |
sudo passwd postgres | |
# create a database and create a new user | |
## switch to postgres user | |
su postgres | |
## create a database | |
createdb forge | |
## log-in forge database | |
psql forge | |
## create a new user | |
CREATE ROLE forge WITH SUPERUSER LOGIN PASSWORD 'forge'; | |
## exit | |
\q | |
exit | |
# configuration | |
## postgresql.conf | |
sudo vim /var/lib/pgsql/data/postgresql.conf | |
### uncomment | |
listen_addresses = 'localhost' | |
port = 5432 | |
## pg_hba.conf | |
sudo vim /var/lib/pgsql/data/pg_hba.conf | |
### change all to md5 | |
local all all md5 | |
host all all 127.0.0.1/32 md5 | |
host all all ::1/128 md5 | |
# restart postgresql service | |
sudo systemctl restart postgresql.service | |
# test connection from localhost | |
psql -h localhost -U forge forge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment