Skip to content

Instantly share code, notes, and snippets.

@FerreiraRaphael
Last active October 16, 2023 12:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FerreiraRaphael/2b74b6b092ce3a6481879cfaa019562d to your computer and use it in GitHub Desktop.
Save FerreiraRaphael/2b74b6b092ce3a6481879cfaa019562d to your computer and use it in GitHub Desktop.
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