Skip to content

Instantly share code, notes, and snippets.

@frankyonnetti
Last active February 17, 2021 00:32
Show Gist options
  • Select an option

  • Save frankyonnetti/d659c2848af6b7c430a989d40374c8e0 to your computer and use it in GitHub Desktop.

Select an option

Save frankyonnetti/d659c2848af6b7c430a989d40374c8e0 to your computer and use it in GitHub Desktop.
Postgresql #postgres
# http://postgresapp.com
# http://big-elephants.com/2012-12/tuning-postgres-on-macos
# import sql file
## In the command promt, not the postgres promt.
## Same why you would import mysql db.
# create
$ createdb database_name
# import
$ psql database_name < data_base_dump
# dump
$ pg_dump database_name > data_base_dump
# drop
$ dropdb database_name
# Adding new environment
* Download repo `git clone git@bitbucket.org:designhammer/centerline-enterprise-db.git`
* Setup MAMP using php54
* Goto http://postgresapp.com and follow the "Installing Postgres.app 123" instructions.
- If you already have it installed:
Stop Postgres
Remove the directory `~/Library/Application Support/Postgres`
Start up Postgres app and click on the "initialize" button.
* Goto termial promt and type:
createdb edb_local
psql edb_local < /Volumes/jobs/sites/EnterpriseDB/dump/edb-dev.2017-05-18.sql
* Duplacate 'example.local.settings.php' and rename it 'local.settings.php'.
'database' => 'edb_local',
'username' => 'macOS_USERNAME', // frankyonnetti
* Reset Drupal admin using `drush uli`.
If Issues:
I was getting an error of "PDOException: could not find driver". Even though MAMP was running the extension.
Installing the pdo extenstion for the localhost version of PHP I am using fixed the above issue.
$ brew install homebrew/php/php55-pdo-pgsql
Another use option:
https://www.drupal.org/node/1438206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment