Last active
May 14, 2018 15:43
-
-
Save jeanlescure/632481d3a473b8d731ffb2954ce16261 to your computer and use it in GitHub Desktop.
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
# Misc operations I use in OSX for PostgreSQL management | |
# Install brew and postgres | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install postgresql | |
postgres -V | |
# If password lost just change 'md5' to 'trust' for all users in following file | |
sudo vim /Library/PostgreSQL/10.x/data/pg_hba.conf | |
# Start/stop the daemon | |
brew services start postgresql | |
brew services stop postgresql | |
# Run sql file as current user (i.e. jeanlescure) | |
psql -d database -a -f databse.sql | |
# Run sql file as postgres user | |
psql -U postgres -d database -a -f databse.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment