× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

How to start postgres on a Mac

George Muresan
Nov 23, 2015
<p> If you run "psql" to connect to the Postgres console and you get an error that says "psql: could not connect to server: No such file or directory", then your Postgres server is probably not running.</p> <p>To start the Postgres server you can use the command</p> <pre><code>pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start</code></pre> <p> </p> <p>You should see a message that says the server was started. You can also have Postgres start automatically when you login to your computer. If you installed Postgres with HomeBrew, first run the command</p> <pre><code class="language-bash">brew info postgres</code></pre> <p>Near the bottom of the output, you should see a line that says something like</p> <pre><code>To have launchd start postgresql at login: ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents</code></pre> <p>Just run that command on the second line and now Postgres will launch everytime you log in.</p> <p> </p> <p> </p>
comments powered by Disqus