Discussion:
createdb: could not connect to database
(too old to reply)
Paul Smith
2006-02-04 17:34:44 UTC
Permalink
Dear All

I have just installed postgres 8.1.2 on a computer running Fedora Core
4 with the rpms got from postgres site. However, I get the following:


$ createdb mydb
createdb: 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 "/tmp/.s.PGSQL.5432"?
$

Any idea about how to overcome the problem?

Thanks in advance,

Paul

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org
Devrim GUNDUZ
2006-02-04 17:51:54 UTC
Permalink
Hi,
Post by Paul Smith
I have just installed postgres 8.1.2 on a computer running Fedora Core
$ createdb mydb
createdb: 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 "/tmp/.s.PGSQL.5432"?
$
Any idea about how to overcome the problem?
Did you start postgresql service?

# service postgresql start

Regards,
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org
Paul Smith
2006-02-04 17:56:28 UTC
Permalink
Post by Devrim GUNDUZ
Did you start postgresql service?
# service postgresql start
Thanks, Devrim. After "service postgresql start", I get

$ createdb mydb
createdb: could not connect to database postgres: FATAL: role
"psmith" does not exist
$

Paul

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
Devrim GUNDUZ
2006-02-04 18:38:06 UTC
Permalink
Hi,
Post by Devrim GUNDUZ
Did you start postgresql service?
Post by Devrim GUNDUZ
# service postgresql start
Thanks, Devrim. After "service postgresql start", I get
$ createdb mydb
createdb: could not connect to database postgres: FATAL: role
"psmith" does not exist
$
- By default, RPM installations use ident authentication. This basically
means that you must be postgres user to access to PostgreSQL. First su
to root, and the su to postgres and run createdb then. (you cannot
directly su to postgres since it does not have an initial password)

- You can also edit pg_hba.conf to allow access to regular users:
http://www.postgresql.org/docs/8.1/static/client-
authentication.html#AUTH-PG-HBA-CONF

- You can create psmith role and allow access to that user.

Regards,
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly
Andreas Kretschmer
2006-02-04 18:45:36 UTC
Permalink
Post by Paul Smith
Post by Devrim GUNDUZ
Did you start postgresql service?
# service postgresql start
Thanks, Devrim. After "service postgresql start", I get
$ createdb mydb
createdb: could not connect to database postgres: FATAL: role
"psmith" does not exist
$
Create a database user:
Become root with su, then 'su - postgres', then createuser.

Read & edit the file 'pg_hba.conf'

http://www.postgresql.org/docs/current/static/client-authentication.html#AUTH-PG-HBA-CONF


HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknow)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq
Paul Smith
2006-02-04 19:35:24 UTC
Permalink
Post by Andreas Kretschmer
Post by Paul Smith
Post by Devrim GUNDUZ
Did you start postgresql service?
# service postgresql start
Thanks, Devrim. After "service postgresql start", I get
$ createdb mydb
createdb: could not connect to database postgres: FATAL: role
"psmith" does not exist
$
Become root with su, then 'su - postgres', then createuser.
Read & edit the file 'pg_hba.conf'
http://www.postgresql.org/docs/current/static/client-authentication.html#AUTH-PG-HBA-CONF
Thanks, Andreas and Devrim. Now, I have postgres working fine here!

Paul

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly

Loading...