$ brew install postgresql # Install PostgreSQL
$ /usr/local/opt/postgres/bin/createuser -s postgres # Create postgres role
$ psql -U postgres # Connect to PostgreSQL
postgres=# \password postgres # Set/change password for postgres
$ brew services start postgresql # Start PostgreSQL server
$ createdb database_name # Create a new database
$ psql database_name < dump_file.sql # Restore previous backup
$ pg_dump database_name > dump_file.sql # Backup database
Last active
April 14, 2020 14:12
-
-
Save ahasverus/43a7c523cd880399f4c313ed8edf4127 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment