Re: initdb can't init the database

From: Wen Yi <896634148(at)qq(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: initdb can't init the database
Date: 2023-06-10 08:40:33
Message-ID: tencent_D086A4035C98EA4057074C952003E2BADD09@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

OK. I find where the problem is, thanks very much!

Yours,
Wen Yi

------------------&nbsp;Original&nbsp;------------------
From: "Ian Lawrence Barwick" <barwick(at)gmail(dot)com&gt;;
Date:&nbsp;Sat, Jun 10, 2023 01:54 PM
To:&nbsp;"Wen Yi"<896634148(at)qq(dot)com&gt;;
Cc:&nbsp;"pgsql-general"<pgsql-general(at)lists(dot)postgresql(dot)org&gt;;
Subject:&nbsp;Re: initdb can't init the database

2023年6月10日(土) 14:30 Wen Yi <896634148(at)qq(dot)com&gt;:
&gt;
&gt; Hi team,
&gt; I use the source to install the postgresql 15.3 (Fedora Linux 37), I create a install.sh as this:
&gt;
&gt; install.sh:
&gt;
&gt; sudo rm -r /home/postgres/pgsql
&gt; sudo mkdir /home/postgres/pgsql
&gt; sudo rm -r /home/postgres/pgsql/lib
&gt; sudo mkdir /home/postgres/pgsql/lib
&gt; ./configure --prefix=/home/postgres/pgsql/bin --exec-prefix=/home/postgres/pgsql/lib --enable-debug --enable-coverage --enable-dtrace --enable-cassert --enable-profiling
&gt; sudo make install
&gt; sudo useradd -m postgres
&gt; sudo passwd -d postgres
&gt; make clean
&gt;
&gt; Then, I start to execute this shell script:
&gt;
&gt;
&gt; [beginnerc(at)bogon postgresql-15.3]$ ./install.sh
&gt; [sudo] beginnerc's passwod:
&gt; ...
&gt; [beginnerc(at)bogon postgresql-15.3]$ su postgres
&gt; bash-5.1$ ./initdb
&gt; initdb: error: no data directory specified
&gt; initdb: hint: You must identify the directory where the data for this database system will reside.&nbsp; Do this with either the invocation option -D or the environment variable PGDATA.
(...)
&gt; Can someone give me some advice?
&gt; Thanks in advance!

The clue is right there after you execute initdb.

You also might want to check the ownership of those directories being created
by the script.

Regards

Ian Barwick

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2023-06-10 13:10:57 Re: Active Active PostgreSQL Solution
Previous Message Ian Lawrence Barwick 2023-06-10 05:54:24 Re: initdb can't init the database