Created
May 7, 2021 20:48
-
-
Save sainak/6bc6db3557771b8e74a3789916473d73 to your computer and use it in GitHub Desktop.
setup postgres in arch linux
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
############################################################## | |
#setup postgresql | |
sudo pacman -S postgresql && \ | |
sudo mkdir /var/lib/postgres/data && \ | |
sudo chown -c -R postgres:postgres /var/lib/postgres && \ | |
sudo -i -u postgres | |
initdb -D '/var/lib/postgres/data' | |
logout | |
sudo systemctl start postgresql | |
createuser -s -U postgres --interactive | |
Enter name of role to add: myUsualArchLoginName | |
#Now you can create databases and access them as an Arch user. Here's an example: | |
createdb myDatabaseName | |
#Use the psql command to access the PostgreSQL database shell, psql. (-d specifies the database to connect to.) | |
psql -d myDatabaseName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment