dbTalk Databases Forums  

help initdb and user

comp.databases.postgresql comp.databases.postgresql


Discuss help initdb and user in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Didier
 
Posts: n/a

Default help initdb and user - 08-15-2010 , 02:57 PM






hello,

With the account "mylogin" I do : initdb -D /home/mylogin/basedir
all is ok

but when i do : psql template1 , respond that user mylogin not exist ?
if i do creatuser mylogin respond not permitted !

I dont understant why this is not ok

can you hekp me (is the login that run initdb begin superuser ? do
create user ?)

thanks

Vincent

Reply With Quote
  #2  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: help initdb and user - 08-15-2010 , 09:50 PM






On Sun, 15 Aug 2010 21:57:08 +0200, Didier wrote:

Quote:
hello,

With the account "mylogin" I do : initdb -D /home/mylogin/basedir all is
ok

but when i do : psql template1 , respond that user mylogin not exist ?
if i do creatuser mylogin respond not permitted !

I dont understant why this is not ok

can you hekp me (is the login that run initdb begin superuser ? do
create user ?)

thanks

Vincent
The problem is that a Postgres instance is created with the user
"postgres" and a database "postgres". Those values are probably hard
coded into the code itself and cannot be changed easily. Do you have any
reason for not following the standards?



--
http://mgogala.byethost5.com

Reply With Quote
  #3  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: help initdb and user - 08-16-2010 , 01:31 AM



Mladen Gogala wrote on 16.08.2010 04:50:
Quote:
On Sun, 15 Aug 2010 21:57:08 +0200, Didier wrote:

hello,

With the account "mylogin" I do : initdb -D /home/mylogin/basedir all is
ok

but when i do : psql template1 , respond that user mylogin not exist ?
if i do creatuser mylogin respond not permitted !

I dont understant why this is not ok

can you hekp me (is the login that run initdb begin superuser ? do
create user ?)

thanks

Vincent

The problem is that a Postgres instance is created with the user
"postgres" and a database "postgres". Those values are probably hard
coded into the code itself and cannot be changed easily.
The superuser account can both be specified when running initdb, it is not hardcoded doesn't need to be "postgres" (it defaults to the account running initdb)

There is no built-in default database other than template0 and template1.
Having a database called "postgres" is only by convention.

Thomas

Reply With Quote
  #4  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: help initdb and user - 08-16-2010 , 01:34 AM



Didier wrote on 15.08.2010 21:57:
Quote:
hello,

With the account "mylogin" I do : initdb -D /home/mylogin/basedir
all is ok

but when i do : psql template1 , respond that user mylogin not exist ?
if i do creatuser mylogin respond not permitted !

What exactly is the error message?
How is the server started? Does it actually use the data directory in /home/mylogin/basedir
Do you have any PGXXX variable defined?
(See: http://www.postgresql.org/docs/curre...pq-envars.html)
Is it possible you have two instances running on different ports?

Regards
Thomas

Reply With Quote
  #5  
Old   
Didier
 
Posts: n/a

Default Re: help initdb and user - 08-16-2010 , 03:25 AM



Le 16/08/2010 08:34, Thomas Kellerer a écrit :
Quote:
Didier wrote on 15.08.2010 21:57:
hello,

With the account "mylogin" I do : initdb -D /home/mylogin/basedir
all is ok

but when i do : psql template1 , respond that user mylogin not exist ?
if i do creatuser mylogin respond not permitted !


What exactly is the error message?
How is the server started? Does it actually use the data directory in
/home/mylogin/basedir
Do you have any PGXXX variable defined?
(See: http://www.postgresql.org/docs/curre...pq-envars.html)
Is it possible you have two instances running on different ports?

Regards
Thomas


message : is it normal ?

pg_ctl -D /home/plagnes/basedir -l logfile start
postmaster successfully started
ps -ef | grep post

mylogin 26095 1 0 Aug15 ? 00:00:00
/usr/lib/postgresql/7.4/bin/postmaster -D /home/mylogin/basedir
mylogin 26096 26095 0 Aug15 ? 00:00:00 postgres: stats buffer
process
mylogin 26097 26096 0 Aug15 ? 00:00:00 postgres: stats
collector process
mylogin 31356 31321 0 10:21 pts/1 00:00:00 grep post


and

psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.5432"?

? what to do ? what can be not ok ?

thanks

Vincent (sorry my english is not very good)

Reply With Quote
  #6  
Old   
Didier
 
Posts: n/a

Default Re: help initdb and user - 08-16-2010 , 03:46 AM



Le 16/08/2010 04:50, Mladen Gogala a écrit :
Quote:
On Sun, 15 Aug 2010 21:57:08 +0200, Didier wrote:

hello,

With the account "mylogin" I do : initdb -D /home/mylogin/basedir all is
ok

but when i do : psql template1 , respond that user mylogin not exist ?
if i do creatuser mylogin respond not permitted !

I dont understant why this is not ok

can you hekp me (is the login that run initdb begin superuser ? do
create user ?)

thanks

Vincent

The problem is that a Postgres instance is created with the user
"postgres" and a database "postgres". Those values are probably hard
coded into the code itself and cannot be changed easily. Do you have any
reason for not following the standards?



what is the standards ?
I install postgresql as root
so I initdb with user "mylogin"
and I launch with user "mylogin"

I do this in other server ans all is ok, I dont know why is not ok on debian

Reply With Quote
  #7  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: help initdb and user - 08-16-2010 , 04:08 AM



Didier wrote on 16.08.2010 10:25:
Quote:
message : is it normal ?

pg_ctl -D /home/plagnes/basedir -l logfile start
postmaster successfully started
ps -ef | grep post

mylogin 26095 1 0 Aug15 ? 00:00:00
/usr/lib/postgresql/7.4/bin/postmaster -D /home/mylogin/basedir
mylogin 26096 26095 0 Aug15 ? 00:00:00 postgres: stats buffer process
mylogin 26097 26096 0 Aug15 ? 00:00:00 postgres: stats collector process
mylogin 31356 31321 0 10:21 pts/1 00:00:00 grep post


and

psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

? what to do ? what can be not ok ?
Oh - you are running an unsupported version (7.4)

I have no experience with using socket connections, but could it be a permission problem on "/var/run/postgresql/"?
Can the "mysql" user (under which the postmaster is running) write to that directory?

As an alternative you could enable tcpip connection and see if that helps.

But first of all you should use a supported PostgreSQL version...

Thomas

Reply With Quote
  #8  
Old   
Didier
 
Posts: n/a

Default Re: help initdb and user - 08-16-2010 , 04:14 AM



Le 16/08/2010 11:08, Thomas Kellerer a écrit :
Quote:
Didier wrote on 16.08.2010 10:25:
message : is it normal ?

pg_ctl -D /home/plagnes/basedir -l logfile start
postmaster successfully started
ps -ef | grep post

mylogin 26095 1 0 Aug15 ? 00:00:00
/usr/lib/postgresql/7.4/bin/postmaster -D /home/mylogin/basedir
mylogin 26096 26095 0 Aug15 ? 00:00:00 postgres: stats buffer process
mylogin 26097 26096 0 Aug15 ? 00:00:00 postgres: stats collector process
mylogin 31356 31321 0 10:21 pts/1 00:00:00 grep post


and

psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

? what to do ? what can be not ok ?

Oh - you are running an unsupported version (7.4)

I have no experience with using socket connections, but could it be a
permission problem on "/var/run/postgresql/"?
Can the "mysql" user (under which the postmaster is running) write to
that directory?

As an alternative you could enable tcpip connection and see if that helps.

But first of all you should use a supported PostgreSQL version...

Thomas

Yes, but I dont know how installa last version ou update

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.