You can connect to the default postgres database as follows: psql -d postgres PostgreSQL comes with psql, a command line tool to interact with the database. The output of this command showed it was successful: => Successfully started `postgresql` (label: ) The Problemīut before pressing the easy button for finding such a quick fix, I wanted to check that a connection worked. So the fix should be simple enough, just start it with the start option of the services subcommand: brew services start postgresql My output showed I had mysql, postgresql, and redis as managed services, but that postgres wasn't started: mysql started dbaron ~/Library/LaunchAgents/ postgresql none redis started dbaron ~/Library/LaunchAgents/ To get information about services that are currently being managed by Homebrew, use the list option of the services subcommand: brew services list However, I couldn't remember whether the database server was running. For production projects, I prefer to setup all databases in Docker containers, but for a simple tutorial, it's fine to use a local service, which I had installed some time ago via brew install postgresql. This all started when I wanted to follow along with a Rails tutorial that required scaffolding a new project with Postgresql as the database. A common usage of the services subcommand is to start and stop databases. In addition to installing, you can also manage services using Homebrew's services subcommand, a wrapper for launchctl. ![]() ![]() ![]() If you work on a Mac, it's likely you use Homebrew to install packages. This post will cover how to troubleshoot when the postgresql service installed via Homebrew on a Mac isn't starting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |