LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-23-2008, 06:51 PM   #1
memo007
Member
 
Registered: Feb 2005
Distribution: Debian, Kanotix, Kubuntu
Posts: 117

Rep: Reputation: 15
Postgres and creating users/ connecting to databases ?


Hello,

When i go and want to create a root user in Postgres i get this..
sudo createuser -U postgres -P

createuser: could not connect to database postgres: 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"?

And when i try to create a database it says
db_create tester

createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "root"
psql: FATAL: Ident authentication failed for user "root"

Last edited by memo007; 08-23-2008 at 06:53 PM.
 
Old 08-23-2008, 08:49 PM   #2
0.o
Member
 
Registered: May 2004
Location: Raleigh, NC
Distribution: Debian, Solaris, HP-UX, AIX
Posts: 208

Rep: Reputation: 35
What user are you trying to do that with? If not already, su to postgres:
su - postgres

From here run your commands.
 
Old 08-23-2008, 09:06 PM   #3
memo007
Member
 
Registered: Feb 2005
Distribution: Debian, Kanotix, Kubuntu
Posts: 117

Original Poster
Rep: Reputation: 15
When i switch to user postgres and run the command db_create tester
I get
createdb: could not connect to database postgres: FATAL: role "postgres" does not exist
psql: FATAL: database "tester" does not exist[*] Database creation complete (check for errors)
 
Old 08-24-2008, 08:34 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What do you get when you run a plain

psql

Is postgres (which version, btw, on which of your listed distros?) actually
running on that machine?
Quote:
Code:
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
suggests it may not be...
 
  


Reply



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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dumping postgres databases brgsousa Linux - Software 1 02-22-2008 01:35 PM
php postgres connecting needed help vickr1z Linux - Newbie 2 11-11-2004 03:13 AM
Perl > connecting to databases Elijah Programming 4 06-18-2004 08:47 AM
connect two databases using postgres? w0000422 Programming 3 02-21-2004 02:18 PM
Error connecting to postgres with pgAdmin koswo Linux - Software 1 02-10-2004 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration