From: | jody <jody(dot)xha(at)gmail(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: db dump from php |
Date: | 2013-01-07 21:48:05 |
Message-ID: | CAKbzMGfYy4amdjKwdm5Xc16qzrh-GbKG=UWhxJBKwmAH=UOseg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hi
thanks to your suggestions i was able to solve the problem:
the socket existed, and it has global permissions:
> jody(at)raven ~/progs/magnus2 $ ls -l /run/postgresql/.s.PGSQL.5432
> srwxrwxrwx 1 postgres postgres 0 Jan 7 20:35 /run/postgresql/.s.PGSQL.5432
but the directory upstairs only allows postgres:
> jody(at)raven ~/progs/magnus2 $ ls -ld /run/postgresql
> drwxrwx--- 2 postgres postgres 80 Jan 7 20:35 /run/postgresql
i now added the user 'apache' to the group 'postgres' and got one step further:
the connection can be made, but now there is a password problem:
> pg_dump: [archiver (db)] connection to database "magnus2" failed: fe_sendauth: no password supplied
I checked again - i have for some reason used a wrong environment
variable for the password:
it should be PGPASSWORD and not PG_PASSWORD
I changed this and now the dump is correctly done and saved.
Thanks again
Jody
On Mon, Jan 7, 2013 at 8:19 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> jody <jody(dot)xha(at)gmail(dot)com> writes:
>> When i call the php script from the command line, the dump i made.
>
>> When i call it from apache, i get the output
>
>> pg_dump: [archiver (db)] connection to database "magnus2" failed:
>> could not connect to server: Permission denied Is the server running
>> locally and accepting connections on Unix domain socket
>> "/run/postgresql/.s.PGSQL.5432"?
>
> Does the apache user have permissions to access that socket file? What
> about the directories containing it?
>
> regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | HideMe | 2013-01-16 21:04:59 | Does psql evaluate OR conditions in order? |
Previous Message | Tom Lane | 2013-01-07 19:19:21 | Re: db dump from php |