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!
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.
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.
PostgreSQL is an open source relational database management system (RDBMS). It is the default database for macOS server.
# 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 ...
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With