Created
December 3, 2019 14:53
-
-
Save spidezad/0b94db32fbb40f98b5160dd2e4abd602 to your computer and use it in GitHub Desktop.
Installing Postgres on Mac
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
Ref: https://medium.com/@Umesh_Kafle/postgresql-and-postgis-installation-in-mac-os-87fa98a6814d | |
# Remove previous versions of PostgreSQL | |
brew uninstall --force postgresql | |
# Delete all Files of Postgres | |
rm -rf /usr/local/var/postgres | |
# Install Postgres with Homebrew | |
brew install postgres | |
# Install PostGIS with Homebrew | |
brew install postgis | |
# Start PostgreSQL server | |
pg_ctl -D /usr/local/var/postgres start | |
# initialize Database | |
initdb /usr/local/var/postgres | |
## IF ERROR | |
# Stop server | |
pg_ctl -D /usr/local/var/postgres stop | |
# Remove old database file | |
rm -r /usr/local/var/postgres | |
# start server again | |
pg_ctl -D /usr/local/var/postgres -l logfile start | |
# Run the initdb command again | |
initdb /usr/local/var/postgres | |
## | |
# Create a new database | |
createdb postgis_test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment