![]() update brew brew install postgresqlĪfter the completion of the installation, we can turn on or turn off PostgreSQL by using the terminal commands below.īrew services start postgresql brew services stop postgresql Step 2: Database Configuration and Administration Once we got Homebrew, the installation of PostgreSQL becomes so easy!Īfter we run update brew on the terminal, we can simply use the command lines below to install PostgreSQL. If you haven’t installed Homebrew, you can run the following command lines on your terminal. Thanks to them, I luckily passed the Bootcamp and now summarized some helpful steps to start PostgreSQL for the rookies like me. □ Anyway, in such a stressful environment, I have received much help from my classmates and really appreciate their selflessness. Our instructor is such a nice guy and just kicked out 10% of our classmates after the Bootcamp. Postgres is smart enough to see that I'm logged in as the postgres user, and it lets me right in.Start Using PostgreSQL with Terminal on MacĪs a rookie, I was totally lost in the Relational Database Course during USF’s intensive Data Science Bootcamp last year. Note that I'm doing all this without specifying the database user I want to connect as. Next, you can connect to this new test database with the following command: First, the command to create a new Postgres database named test: (As you can see from these commands, the root directory of the Postgres server on my Mac computer is /usr/local/pgsql.)īonus: How to create and connect to a Postgresql databaseĪs a quick bonus (and a reminder to myself), here's how you create and then use a Postgres database. usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start Here's how I include the Postgres bin directory in my path:Īnd here's the command I use to start the Postgres server: Once you're logged in as the postgres user, you just need to make sure your path includes the Postgres bin directory, and then issue the command to start Postgres. So, Step 1 of starting Postgres is to open a Terminal window, and switch over to that user account, like this:Īfter issuing this command, you'll also need to provide the password for the "postgres" user. After I finished that installation, a "postgres" user account was created on my Mac during the installation process. So, to keep that from happening again, here's a quick tip on how to start Postgres (Postgresql) on a Mac OS X computer.Ī long time ago I followed this Apple tutorial on how to install Postgress on a Mac. Wow, it had been a long time since I last started Postgres on my Mac computer ( a MacBook Pro, to be specific), and it took almost almost 20 minutes to remember how to do it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |