Re: Cant create new users or databases

From: AlphaByte <alan(at)alphabyte(dot)co(dot)nz>
To: John McKown <joarmc(at)swbell(dot)net>, pgsql list - general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cant create new users or databases
Date: 2000-09-17 12:32:24
Message-ID: 00091800411700.01149@alphabyte.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 17 Sep 2000, John McKown wrote regarding "Re: [GENERAL] Cant create new users or databases":
>
> Well, now it looks as if you are logged in as "abyte". You need to be
> logged in as "postgres" in order to start the daemon and to do the
> "createuser". Please forgive my faulty memory, but I think that you need
> to do this:
>
> 1) Login as "postgres"

And so the plot thickens. In order to login as postgres you
have to specify the data environment otherwise it says this:

postgres does not know where to find the database system
data. You must specify the directory that contains the
database system either by specifying the -D invocation
option or by setting the PGDATA environment variable.

Which is what the command I used was supposed to do, ie:

postgres -D /var/lib/pgsql

But I don't know if my syntax is wrong there, but that is
where postmaster.pid is though.

> 2) Issue the following commands at the prompt (starts
the backend): > export PGDATA=/var/lib/pgsql
> mkdir -p $PGDATA
> /usr/bin/initdb --pglib=/var/lib/pgsql --pgdata=/var/lib/pgsql/data
> /usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start >/dev/null 2>&1

Should I include all this when I login for the first time
perhaps?

> 3) At this point, the database backend should be up.
> 4) Now issue the commands (you're still logged in as "postgres"!)
> createuser abyte
> In this command, answer "y" to the two questions about can the user create
> databases & users. This will allow you to use "abyte" as your normal
> PostgreSQL administrator.
> 5) Logoff of "postgres" and login as "abyte"
> 6) Issue the command: "initdb". This will create the "abyte" database with
> no tables in it.
> 7) You should now be able to issue the "pgsql" command and do whatever.
>
> Oh, one thing that I did was (as "root") change the /etc/profile to
> contain the two lines:
>
> export PGLIB=/var/lib/pgsql
> export PGDATA=/var/lib/pgsql/data
>
OK, I'll try that but first I just want to login first.

>
> Oh, you might get more and better information if you also post your
> questions to one of the pgsql-hackers(at)postgresql(dot)org or the
> psql-general(at)postgresql(dot)org mailing lists. Feel free to
> continue to email me if you want, but I'm not a real PostgreSQL heavy
> (yet).

Thanks anyway, any help is appreciated at this point :0)

Alan

--
AlphaByte: PO Box 1941, Auckland, New Zealand
Specialising in:Graphic Design, Education and Training,
Technical Documentation, Consulting.
http://www.alphabyte.co.nz

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2000-09-17 13:02:25 Re: Problems buidling PostgreSQL v7.0.2 on Solaris 2.5.1
Previous Message Neil Conway 2000-09-17 04:15:37 LOCK TABLE question