Created
February 6, 2015 08:03
-
-
Save tfrisk-old/6a60b968c8b9780d987b to your computer and use it in GitHub Desktop.
How to setup local postgres database for local Rails project
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
# I have to look this up every time so it's about time to write it down | |
# Source: https://stackoverflow.com/questions/19953653/how-to-set-up-postgres-database-for-local-rails-project | |
Login to postgresql prompt as the postgres user | |
# sudo su postgres -c psql | |
Create a postgresql user for your project | |
=# create user username with password 'password'; | |
Setup your postgres user with the same name and password as your Ubuntu user and make him a postgres superuser | |
=# alter user username superuser; | |
Create the development and test databases | |
=# create database projectname_development; | |
=# create database projectname_test; | |
Give permissions to the user on the databases | |
=# grant all privileges on database projectname_development to username; | |
=# grant all privileges on database projectname_test to username; | |
To end the postgresql session type \q | |
Update password for the user | |
=# alter user username with password ‘new password’; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment