Created
June 15, 2022 04:21
-
-
Save jishanshaikh4/cd0bb336285f580c15b562e06c77dbcc to your computer and use it in GitHub Desktop.
Setup postgres in Ubuntu
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 postgres | |
sudo apt update | |
sudo apt install postgresql postgresql-contrib | |
# Switch to your postgres account/user | |
sudo -i -u postgres | |
psql | |
OR | |
sudo -u postgres psql | |
# Create new role | |
sudo -u postgres createuser --interactive | |
Enter name of role to add: myUserName | |
Shall the new role be a superuser? (y/n) y | |
# Create new database | |
sudo -u postgres createdb | |
# Change default passwords | |
\password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment