Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postgresql createuser: could not connect to database
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
misterLu
Guru
Guru


Joined: 14 Sep 2003
Posts: 430
Location: Poland

PostPosted: Tue Oct 05, 2004 8:19 pm    Post subject: Postgresql createuser: could not connect to database Reply with quote

I have new Postgresql on my destkop. I can't connect to it.

postgres is started:
Code:

 # ps aux | grep post
root      4178  0.0  0.1  4212  628 pts/0    S+   22:11   0:00 tail -f /var/lib/postgresql/data/postgresql.log
postgres  4302  0.0  0.4 27520 2252 pts/2    S    22:11   0:00 /usr/bin/postmaster -d 5 -N 128 -B 2048 -D /var/lib/postgresql/data
postgres  4304  0.0  0.3  9396 1940 pts/2    S    22:11   0:00 postgres: stats buffer process                                     
postgres  4307  0.0  0.3  8404 1996 pts/2    S    22:11   0:00 postgres: stats collector process                                 

but (as a root) I cannot create nor user neither database:
Code:

# createuser x
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
createuser: could not connect to database template1: FATAL:  user "root" does not exist

 # createdb xxx
createdb: could not connect to database template1: FATAL:  user "root" does not exist



How can I fix it ?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20583

PostPosted: Tue Oct 05, 2004 8:23 pm    Post subject: Reply with quote

Moved from Portage & Programming.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
wangotango
n00b
n00b


Joined: 26 Aug 2003
Posts: 1
Location: Alexandria, Virginia

PostPosted: Tue Nov 02, 2004 2:34 am    Post subject: Reply with quote

Start the database, su - to root, su to postgres (no password needed), run createuser command as postgres user.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum