Community Documentation

Postgres on Max OS X with MAMP

Last updated February 13, 2012. Created by diricia on February 13, 2012.
Log in to edit this page.

At the moment I'm running MAMP Pro, but the setup should work with MAMP free version as well.

Requirments;
Download and install MAMP from MAMP

  1. Download and install postgres 8.4 or higher from Enterprise DB
  2. Add the bin directory of postgres, /Library/PostgreSQL/8.4/bin to the PATH in your .bashrc file in your home directory. Remember to run ./.bashrc to update the path.
  3. Sudo to your root user and execute the following commands. '>' is the prompt on your terminal and should be excluded. Text in () is an explanation and should not excluded.
    1. > su postgres (log in as the postgres user)
    2. > createuser --no-createdb --no-password (choose as a super user)
    3. > createuser --no-createdb ----pwprompt devel (enter a password 'drupal', and choose as a super user, this is if your site is using the standard devel user with password drupal)
    4. > exit
  4. Edit table at the bottom of the /Library/PostgreSQL/8.4/data/pg_hba.conf file to so that the options for local look like this. This states that the devel (or your user) must have a md5 password and all other users can log in with no password. (This is only recommended for your local host and is not secure on a server)

    # "local" is for Unix domain socket connections only
    local all devel md5
    local all all trust
  5. In your applications folder stop and start the postgres server using the apps under the Postgres folder
  6. Log out of your root user
  7. Create your postgres database as specified in INSTALL.pgsql.txt:
    1. > createdb --encoding=UTF8 --owner=username databasename (The owner is devel or the user you created)

Page status

Needs technical review

Log in to edit this page

About this page

Drupal version
Drupal 7.x
Audience
Programmers
Level
Intermediate
Keywords
mac osx, MAMP, postgres

Develop for Drupal

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here