Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Install postgresql on my mac os x machine via homebrew

I was trying to install the postgres through terminal on mac os. I used homebrew to install the postgres. During the install I got following error

"Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink share/man/man3/SPI_connect.3"

I also got error regarding initdb

"initdb: file "/usr/local/share/postgresql/postgres.bki" does not exist This might mean you have a corrupted installation or identified the wrong directory with the invocation option -L. Warning: The post-install step did not complete successfully You can try again using brew postinstall postgresql"

After the install I am not able to run any of postgres commands. I would really appreciate any help as I am new to postgres. Please, provide little explanation.

Thank You!

like image 807
Harshit Pareek Avatar asked Jan 16 '18 23:01

Harshit Pareek


People also ask

Why is PostgreSQL not installing?

If you encounter an error about being unable to create the postgres service user, turn off any antivirus programs and re-run the installer. >\database directory and manually set the permissions for the \data subdirectory. If the subdirectory \data does not exist, create. Then uninstall PostgreSQL and re-install.

What is the best way to install PostgreSQL on Mac?

Step by step guide to set up a local PostgreSQL on Mac using DBngin: Download DBngin from it's download page and install on your Mac just like any other Mac apps. Open DBngin and click on + new server button. Choose PostgreSQL from the driver list, choose your PostgreSQL version, and name you server.

Is PostgreSQL compatible with Mac?

PostgreSQL is an open source relational database management system (RDBMS). It is the default database for macOS server.

How can I start PostgreSQL server on macOS X?

# Remove old database files (if there was any) $ rm -rf /usr/local/var/postgres # Install the binary $ brew install postgresql # init it $ initdb /usr/local/var/postgres # Start the PostgreSQL server $ postgres -D /usr/local/var/postgres # Create your database $ createdb mydb # Access the database $ psql mydb psql (9.0 ...


1 Answers

Not sure if this solution is the best, but so far this is the only one.

Note: I did this on a macOS environment

I have chowned the directory I wasn't allowed to write. (chown -R user/usr/local/lib/pkgconfig) /usr/local/lib/pkgconfig` (assumed that dir should be mine anyway - since it's within /usr/local)

I ran brew link postgres - so the links required are there

Then initdb /usr/local/var/postgres -E utf8 worked perfectly.

like image 106
Gabi Dj Avatar answered Oct 16 '22 06:10

Gabi Dj