Re: initdb can't init the database

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: Wen Yi <896634148(at)qq(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: initdb can't init the database
Date: 2023-06-10 05:54:24
Message-ID: CAB8KJ=jaGAwYD6=_WTZFOoDPboEre3Kx4kCxS6bhgyU0f_PyCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wen Yi 2023-06-10 08:40:33 Re: initdb can't init the database
Previous Message Wen Yi 2023-06-10 05:30:02 initdb can't init the database