Jul 11, 2018 - To start using database services, run the code below on the terminal brew services start postgresql. At first run, homebrew might need to install. The cleanest way by far to start/stop/restart postgres if you have installed it through brew is to simply unload and/or load the launchd configuration file that comes with the installation.
![Start Postgres Mac Start Postgres Mac](http://www.psequel.com/img/screenshot3.png)
To make macOS automatically launch your PostgreSQL server at system start, do the following: 1. Edit the postgres-wrapper.sh script and adjust the file path variables at its start to reflect where you have installed Postgres, if that's not /usr/local/pgsql. Copy the modified postgres-wrapper.sh script into some suitable installation directory. It can be, but doesn't have to be, where you keep the Postgres executables themselves. Edit the org.postgresql.postgres.plist file and adjust its path for postgres-wrapper.sh to match what you did in step 2. Also, if you plan to run the Postgres server under some user name other than 'postgres', adjust the UserName parameter value for that. Copy the modified org.postgresql.postgres.plist file into /Library/LaunchDaemons/.
You must do this as root: sudo cp org.postgresql.postgres.plist /Library/LaunchDaemons because the file will be ignored if it is not root-owned. At this point a reboot should launch the server. But if you want to test it without rebooting, you can do sudo launchctl load /Library/LaunchDaemons/org.postgresql.postgres.plist.
Install PostgreSQL on Mac OS X via Brew Akbar S. Ahmed Feb 21, 2015 Step-by-step instructions PostgreSQL is an open source object-relational database. It is a popular database choice when using a relational database. Installing PostgreSQL on Mac OS X is simple.
Software versions The instructions in this post were created / tested using the following sofware versions:. Mac OS X Yosemite 10.10. HomeBrew 0.9.5. PostgreSQL 9.4 Install PostgreSQL via Brew First, we will update Brew and then install PostgreSQL.
Brew update brew install postgres Start PostgreSQL Start the PostgreSQL server in the foreground. There are optional instructions below in case you would like to start PostgreSQL automatically. Brew initializes the database during installation. Postgres -D /usr/local/var/postgres Login to PostgreSQL for the first time. Press Cmd + T to open a new terminal tab. Whoami is surrounded by backticks, not single quotes.
![Mac Mac](/uploads/1/2/5/4/125446354/755880568.png)
Createdb `whoami` Login to PostgreSQL with your user account. Psql Optional: Install AdminPack AdminPack is used by PgAdmin. If you plan on using the PgAdmin UI, then installing AdminPack is a good idea. Psql postgres -c 'CREATE EXTENSION 'adminpack';' Optional: Configure PostgreSQL to start automatically The commands below configure PostgreSQL to start automatically. Mkdir -p /Library/LaunchAgents ln -sfv /usr/local/opt/postgresql/.plist /Library/LaunchAgents launchctl load /Library/LaunchAgents/homebrew.mxcl.postgresql.plist Summary Congrats. PostgreSQL is now installed on Mac OS X.
You are now ready to start using PostgreSQL for development.