Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to install, config and create a superuser on postgresql fedora
#Login as root
su -
#Switch to postgres user
su postgres
#Connect to the DB
psql
#Create user
CREATE USER username SUPERUSER INHERIT CREATEDB CREATEROLE;
#Alter it`s password
ALTER USER username PASSWORD 'password';
#Install postgresql
sudo dnf install postgresql-server postgresql-contrib postgresql-devel
#Init DB
sudo postgresql-setup --initdb
#Init Service
sudo systemctl start postgresql
#Service init every boot
sudo systemctl enable postgresql
# Edit the file /var/lib/pgsql/data/pg_hba.conf to look like this
# After that the service should be restarted
# sudo systemctl restart postgresql
#
# TYPE DATABASE USER ADDRESS METHOD
local all postgres peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.