Last active
October 16, 2023 12:43
-
-
Save FerreiraRaphael/2b74b6b092ce3a6481879cfaa019562d to your computer and use it in GitHub Desktop.
How to install, config and create a superuser on postgresql fedora
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
#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'; |
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
#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 |
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
# 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