pg_ctl: no database directory specified and environment variable PGDATA unset , centos 7 postgreSQL

centos 7 postgreSQL pg_ CTL invalid

In the


Next configuration

export PGDATA=/var/lib/pgsql/11.0/data 

But it didn’t work.

However, it can be written like this

Go to


After that, it can be executed

./pg_ctl -D /var/lib/pgsql/11.0/data start

Take notes

Read More: