Reputation: 5953
Background - a few months ago, I purchased a new Macbook to replace an iMac. When I restored my data from my old iMac to the new Macbook, I accidentally used davidburton
as the user when on the iMac I was burtondav
.
I was then not able to run postgreSQL or Rails.
I used this symlink command to fix it:
ln -s /Users/davidburton /Users/burtondav
But, yesterday I upgraded to OS X Mavericks. Now I can't start postgreSQL or use Rails. Even after re-entering the symlink.
Is there any way to fix it???
If I have to re-install postgreSQL:
My postgreSQL files are in usr/local/var/postgres I'm pretty sure I used homebrew to install it.
How can I re-install postgreSQL without loosing my data?
I was going to dump the whole database and reload after I reinstall postgreSQL. But I can't start postgreSQL in order to dump the data.
This is what I get:
$ postgres -D /usr/local/var/postgres
2013-10-24 15:30:07 GMT < > %FATAL: data directory "/usr/local/var/postgres" has wrong ownership
2013-10-24 15:30:07 GMT < > %HINT: The server must be started by the user that owns the data directory.
Should I change the ownership from burtondav to davidburton?
Thanks for your help!!
Upvotes: 2
Views: 1023
Reputation: 54902
You should change the owner of the postgres data directory:
chown davidburton /user/local/var/postgres
# or
sudo chmod ugo=rwX /user/local/var/postgres # You might want to change the permissions as your needs
(You might need to use sudo
)
You didn't post the error when you try to start rails/postgres, maybe this question can help you: ERROR: Failed to build gem native extension on Mavericks
Upvotes: 3