I'm on macOS Sierra and have had issues with installing Postgres. I installed it with brew and with the Postgres.app native app from postgresapp.com
After using brew uninstall postgres and following Postgres.app's uninstallation instructions from their website. I'm still seeing the a 'PostgreSQL' user on my machine and when I run sudo find / -name "*postgres*" I still see a lot of output (some is pgAdmin4 and Postico which I'm happy to keep, since I'll be postgres soon), much of which is in the /Library/PostgreSQL/9.6 directory including an actual postgres binary.
Is it safe to just remove the entire directory? How do I completely remove Postgres from my machine so I can start from scratch?
After running brew uninstall postgres, removing postgres.app, and removing the other postgres stuff (that came from https://www.postgresql.org/) in the terminal, my computer worked properly for months and reinstallation went smoothly, too.
Related
I am trying to install mongo on mac os X yosemite, i have already installed the current version of PECL mongo db ad mongo extension files mongo.so, but still this error The MongoDB PECL extension has not been installed or enabled comes when i open any kind of localhost page, please help i have been stuck in this situation since a week, also i have tried other versions of mongo too but the error appears to be the same.
Okay i finally found the solution.
I used homebrew to install pecl extension.
then actually i was using
sudo vi php.ini
command to edit and insert the mongo.so extension
but later i downloaded sublime text edited the note and inserted the extension manually and restarted xampp
I'm using OS X Yosemite in a fresh MacBook. Just installed Homebrew and some essential packages, having moved to this new computer recently.
I noticed that once in a while I get linking errors when I install new brew packages. For some reason, the permissions of /usr/local/bin and /usr/local/share keeps changing back to root:wheel even after I did chmod andchgrp several times to make it FP:admin (FP being my username).
Take note, it fixes the permissions for a time, allowing me to install new brew packages, and changes back to root:wheel automatically at random (at least as per my observation).
Been trying to Google answer to no avail. Any thoughts at what might be wrong with my setup? Appreciate the insights. Thanks!
You using Sophos by chance?
Via https://apple.stackexchange.com/questions/178760/how-to-figure-out-what-is-causing-the-ownership-of-usr-local-to-change-from-my
"I had this exact same issue, and it turns out Sophos auto-update was to blame. I figured this out by running: sudo fs_usage | grep "usr/local"
Running an existing MBP, now on 10.10.5 and this is happening to me seemingly every time I sleep/wake. At least once daily. No clue what's causing this yet.
Claco's answer about Sopho's Anti Virus software led me to fix this problem on my machine. I recommend upgrading Sophos.
My machine is a new 2015 Mac Book Pro (OSX 10.10.5) with Sophos 9.2.8 installed on it at first. Every time I restarted and ran brew doctor I'd get the same warnings about permissions in /usr/local/bin, /usr/local/share, etc. -- even though I reset those permissions each time.
After upgrading to Sophos Anti Virus 9.4.1, setting the permissions again, and restarting, brew doctor finally returns Your system is ready to brew.
I tried to run homebrew install of Postgres and it looks like it's installing 9.1.4 the same as whats con my new Mac 10.8 system. After I ran the command brew install postgresql
and ran initdb /usr/local/var/postgres -E utf8
I checked version .
psql --version
psql (PostgreSQL) 9.1.4
which psql
/usr/local/bin/psql
This looks to me like its install the same version which would be originally in /usr/bin/
I'm trying to get it to run the latest version which looks like its 9.2.2
What am I missing here.
You may want to check in /Library/PostgreSQL/ and see if this directory exists. From my understanding, Homebrew will often install PostgreSQL into that path. If this is the case you may have a newer version of PostgreSQL than what you think and setting your PATH envar will fix the problem.
If this is the case you will want to set your system to start up only one of the databases, or if it starts up both set them on different ports.
I tried to install PostgreSQL 9.1.2 for Mac OS X 10.6 and it asked me to edit the sysctl.conf file inside the /etc/ directory, so it could use more of the shared memory PostgreSQL was asking for.
I went ahead and edited the file, saved it, rebooted and then on the login screen I was asked to login as safe boot for some reason, I logged in and internet did not seem to work and the dock menu was laggy.
So it was pretty obvious this was happening because of the sysctl.conf file that I edited before the reboot, so I went back into the /etc directory and deleted the sysctl.conf file thinking it would auto-create a new sysctl.conf file with the default settings but that wasn't the case even after a reboot.
So now I'm pretty much left without a sysctl.conf file, I read the Mac Developer documentation for this file and it didn't say much. I know I probably shouldn't be messing with files that I don't have a clue about but I really wanted to get PostgreSQL working for my local Ruby on Rails development.
Anything on this topic would be helpful.
I have no /etc/sysctl.conf file on OS X 10.7.2 (Lion).
I suggest you save yourself a lot of headaches and install Postgres using the Homebrew package manager.
The steps, once XCode is installed, are:
Install Homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Install Postgres
brew update; brew install postgres
Initialize Postgres
initdb /usr/local/var/postgres
Set Postgres to run automatically
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.1.2/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Mine contains the following:
kern.sysv.shmmax=134217728
kern.sysv.shmmin=1
kern.sysv.shmmni=256
kern.sysv.shmseg=64
kern.sysv.shmall=32768
I have Lion myself but I don't think there was anything else in it when I was using Snow Leopard.
I want to run a Rails app on Heroku so I installed PostgreSQL on my Snow Leopard machine using Homebrew. Currently, brew installs 9.1.2 into /usr/local/Cellar/postgresql. After some research, I discovered that the free, shared version of Heroku requires 8.3.x. While homebrew-alt doesn't have 8.3, it does have 8.4 so I downloaded it instead and it installed into /usr/local/Cellar/postgresql8. I then confirmed that I am able to create and run databases on each version. Thinking that I could use "brew [link | unlink] to switch back and forth, I ran "brew unlink postgresql8" and then "brew link postgresql". However, running the latter command results in this error:
Linking /usr/local/Cellar/postgresql/9.1.2...
Error: Cannot link postgresql
Another version is already linked: /usr/local/Cellar/postgresql/9.1.2
Is there any way to do this (switch back and forth) or am I misunderstanding how brew link/unlink is supposed to be used?
By the way, "brew list" shows "postgresql" and "postgresql8" so I don't think it's the case that I should say "brew link postgresql9".
Thanks.
Use brew switch, which is an extension shipped with Homebrew. In your case, you could use 8.4 by running
$ brew switch postgresql 8.4
Thanks, mipadi! That did the trick. There was only one additional thing that I needed to do. The 'brew switch' command assumes all versions of postgresql are installed in /usr/local/Cellar/postgresql. That was not the case with version 8.4.8 as it was installed in /usr/local/Cellar/postgresql8. Consequently I had to create a symbolic link to point to this older version:
cd /usr/local/Cellar/postgresql
ln -s ../postgresql8/8.4.8 8.4.8
Naturally, it also makes sense to keep your database clusters in separate directories:
/usr/local/var/postgres/8.4.8
/usr/local/var/postgres/9.1.2