LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postgres and creating users/ connecting to databases ? (https://www.linuxquestions.org/questions/linux-software-2/postgres-and-creating-users-connecting-to-databases-664918/)

memo007 08-23-2008 06:51 PM

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"

0.o 08-23-2008 08:49 PM

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

From here run your commands.

memo007 08-23-2008 09:06 PM

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)

Tinkster 08-24-2008 08:34 PM

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...


All times are GMT -5. The time now is 03:03 AM.