Created
April 19, 2013 01:07
-
-
Save gbenedict/5417415 to your computer and use it in GitHub Desktop.
Fixing a homebrew install of Postgres that won't start.
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
sudo mkdir /var/pgsql_socket/ | |
sudo ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/ | |
# initialize the database | |
initdb /usr/local/var/postgres -E utf8 | |
# start your database | |
pg_ctl -D /usr/local/var/postgres/data -l logfile start | |
# setup a db and user for the current Mac user | |
createdb $USER | |
createuser -s -U $USER | |
# go create application databases | |
createdb app_d | |
# go backup a database from heroku and restore it locally. | |
heroku pgbackups:capture -a app --expire | |
curl -o ~/Downloads/app.dump `heroku pgbackups:url -a app` | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d app_d ~/Downloads/app.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment