Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've had a very difficult time trying to set up a postgres database. I am using Mac OS X 10.9.2.

I am using this tutorial: http://tutorials.jumpstartlab.com/topics/environment/environment.html

The Postgres section can be found 2/3 of the way down the page.

After installing Homebrew and commanding brew install postgresql

we create a database by:

sudo mkdir -p /usr/local/pgsql/data
sudo chown postgres:postgres /usr/local/pgsql/data
sudo su postgres
initdb -D /usr/local/pgsql/data
createuser `whoami`

When I do

sudo chown postgres:postgres /usr/local/pgsql/data

it returns the error

chown: postgres: illegal user name

I can't seem to find a simple command to add a user - adduser and useradd have returned "command not found", with and without sudo. I am not sure what the problem is. Is there a simple command I can do?

share|improve this question
    
Well, is there a user named "postgres" on your system? – Craig Ringer May 23 '14 at 11:27
    
You likely don't have a postgres user on your system. Try creating one by running sudo dscl . -create /Users/postgres – Stratus3D Oct 13 '15 at 22:02
    
Refer to this answer for more information: stackoverflow.com/a/6815565/1245380 – Stratus3D Oct 13 '15 at 22:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.