Обсуждение: Cannot initdb on fresh install

Поиск
Список
Период
Сортировка

Cannot initdb on fresh install

От
Dimitri
Дата:
Greetings

I am attempting a fresh install of postgresql9.5 on FreeBSD
I am at the point of initialising the database server. When I issue the
initdb command (see below) I am requested to enter a password. Which
password am I meant to insert here?
When I cat /etc/passwd I notice there is a user pgsql ( a pseudo user)
which I never created so I dont know what the password is for pgsql.
I have tried using the root password, my user's password, and a user I
created (postgres) but all to no avail.
Can anyone help me along?
Regards
Dimitri


$ /usr/local/etc/rc.d/postgresql initdb
Password:
su: Sorry



Re: Cannot initdb on fresh install

От
Tom Lane
Дата:
Dimitri <dimitri@shackletonpacific.com> writes:
> I am attempting a fresh install of postgresql9.5 on FreeBSD
> I am at the point of initialising the database server. When I issue the
> initdb command (see below) I am requested to enter a password. Which
> password am I meant to insert here?
> When I cat /etc/passwd I notice there is a user pgsql ( a pseudo user)
> which I never created so I dont know what the password is for pgsql.
> I have tried using the root password, my user's password, and a user I
> created (postgres) but all to no avail.
> Can anyone help me along?

I'm mostly guessing here, since I do not know how the FreeBSD package
you're using is set up; but it's fairly common for PG packages to create
a "postgres" or "pgsql" daemon user without setting any password for it.
That means you can't log in as that user.  Rather, you're supposed to do
something like "sudo su - pgsql" to become that user, and then you can
do tasks like running initdb as that user.

Alternatively, you can use your root powers to assign a password for that
user, if you prefer that way.  But keep in mind that that user is mainly
meant for running the PG server, not for manual tasks.

I'd sort of expect the package to include some documentation around this
point ...

            regards, tom lane


Re: Cannot initdb on fresh install

От
Larry Rosenman
Дата:
On 2016-02-03 12:22, Tom Lane wrote:
> Dimitri <dimitri@shackletonpacific.com> writes:
>> I am attempting a fresh install of postgresql9.5 on FreeBSD
>> I am at the point of initialising the database server. When I issue
>> the
>> initdb command (see below) I am requested to enter a password. Which
>> password am I meant to insert here?
>> When I cat /etc/passwd I notice there is a user pgsql ( a pseudo user)
>> which I never created so I dont know what the password is for pgsql.
>> I have tried using the root password, my user's password, and a user I
>> created (postgres) but all to no avail.
>> Can anyone help me along?
>
> I'm mostly guessing here, since I do not know how the FreeBSD package
> you're using is set up; but it's fairly common for PG packages to
> create
> a "postgres" or "pgsql" daemon user without setting any password for
> it.
> That means you can't log in as that user.  Rather, you're supposed to
> do
> something like "sudo su - pgsql" to become that user, and then you can
> do tasks like running initdb as that user.
>
> Alternatively, you can use your root powers to assign a password for
> that
> user, if you prefer that way.  But keep in mind that that user is
> mainly
> meant for running the PG server, not for manual tasks.
>
> I'd sort of expect the package to include some documentation around
> this
> point ...
>
>             regards, tom lane
sudo su - pgsql
is the correct way.

(from a FreeBSD user)

--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 214-642-9640                 E-Mail: ler@lerctr.org
US Mail: 7011 W Parmer Ln, Apt 1115, Austin, TX 78729-6961


Re: Cannot initdb on fresh install

От
Larry Rosenman
Дата:
On 2016-02-03 12:22, Tom Lane wrote:
> Dimitri <dimitri@shackletonpacific.com> writes:
>> I am attempting a fresh install of postgresql9.5 on FreeBSD
>> I am at the point of initialising the database server. When I issue
>> the
>> initdb command (see below) I am requested to enter a password. Which
>> password am I meant to insert here?
>> When I cat /etc/passwd I notice there is a user pgsql ( a pseudo user)
>> which I never created so I dont know what the password is for pgsql.
>> I have tried using the root password, my user's password, and a user I
>> created (postgres) but all to no avail.
>> Can anyone help me along?
>
> I'm mostly guessing here, since I do not know how the FreeBSD package
> you're using is set up; but it's fairly common for PG packages to
> create
> a "postgres" or "pgsql" daemon user without setting any password for
> it.
> That means you can't log in as that user.  Rather, you're supposed to
> do
> something like "sudo su - pgsql" to become that user, and then you can
> do tasks like running initdb as that user.
>
> Alternatively, you can use your root powers to assign a password for
> that
> user, if you prefer that way.  But keep in mind that that user is
> mainly
> meant for running the PG server, not for manual tasks.
>
> I'd sort of expect the package to include some documentation around
> this
> point ...
>
>             regards, tom lane


oh, and:
service postgresql initdb

will do the init.

--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 214-642-9640                 E-Mail: ler@lerctr.org
US Mail: 7011 W Parmer Ln, Apt 1115, Austin, TX 78729-6961


Re: Cannot initdb on fresh install

От
Daniel Tordable Dasilva
Дата:
Abyway installing postgres from either ports or packages don't ask you for a password. pgsql is a pseudo user used to run the daemon within that user. Take a note about that "service postgresql initdb" message. Always run the postgres administrative commands under that fake pgsql user (via sudo for example).

El 3 de febrero de 2016 19:25:41 CET, Larry Rosenman <ler@lerctr.org> escribió:
On 2016-02-03 12:22, Tom Lane wrote:
Dimitri <dimitri@shackletonpacific.com> writes:
I am attempting a fresh install of postgresql9.5 on FreeBSD
I am at the point of initialising the database server. When I issue
the
initdb command (see below) I am requested to enter a password. Which
password am I meant to insert here?
When I cat /etc/passwd I notice there is a user pgsql ( a pseudo user)
which I never created so I dont know what the password is for pgsql.
I have tried using the root password, my user's password, and a user I
created (postgres) but all to no avail.
Can anyone help me along?

I'm mostly guessing here, since I do not know how the FreeBSD package
you're using is set up; but it's fairly common for PG packages to
create
a "postgres" or "pgsql" daemon user without setting any password for
it.
That means you can't log in as that user. Rather, you're supposed to
do
something like "sudo su - pgsql" to become that user, and then you can
do tasks like running initdb as that user.

Alternatively, you can use your root powers to assign a password for
that
user, if you prefer that way. But keep in mind that that user is
mainly
meant for running the PG server, not for manual tasks.

I'd sort of expect the package to include some documentation around
this
point ...

regards, tom lane


oh, and:
service postgresql initdb

will do the init.

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.