Created
July 1, 2020 20:35
-
-
Save pablodz/1a0423b2132e15b9d982d0ffeeae9720 to your computer and use it in GitHub Desktop.
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
| # Check postgres sql | |
| sudo -u postgres psql -c "SELECT version();" | |
| # Creating a new user in postgres | |
| sudo su - postgres -c "createuser your_username" | |
| # Creating the database | |
| sudo su - postgres -c "createdb your_database_name" | |
| # Enter postgres line command | |
| sudo -u postgres psql | |
| # Set the privileges of the user for the database | |
| # Maybe this part need to we copy&paste separetely | |
| grant all privileges on database your_database_name to your_username; | |
| \q | |
| # \q will end postgresql command line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment