开发者

postgresql start db

开发者 https://www.devze.com 2023-03-21 17:26 出处:网络
I have postgresql running (/opt/local/lib/postgresql90/bin). The data base is set up @ /Users/demet8/postgres/data.

I have postgresql running (/opt/local/lib/postgresql90/bin).

The data base is set up @ /Users/demet8/postgres/data.

I check to make sure postgresql is running with

ps aux | grep postgres

demet8 9851 0.0 0.1 614276 1184 ?? Ss 12:40PM 0:00.24 postgres: autovacuum launcher process

demet8 9850 0.0 0.0 614020 436 ?? Ss 12:40PM 0:00.91 postgres: wal writer process

demet8 9849 0.0 0.0 614020 496 ?? Ss 12:40PM 0:01.22 postgres: writer process

demet8 9847 0.0 0.1 614开发者_如何学Go020 2248 s002 S 12:40PM 0:00.61 /opt/local/lib/postgresql90/bin/postgres -D /Users/demet8/postgres/data demet8 11127 0.0 0.0 599820 468 s002 S+ 2:05PM 0:00.00 grep postgres demet8 9852 0.0 0.0 610092 368 ?? Ss 12:40PM 0:00.26 postgres: stats collector process

I go back into: /opt/local/lib/postgresql90/bin & now try to start the db with ./pg_ctl start. This is the error msg I get:

pg_ctl: no database directory specified and environment variable PGDATA unset Try "pg_ctl --help" for more information.

Any suggestions on to what I can be doing wrong. I googled around the web for answers & I haven't found a solution.


$ su -
# su - postgres

Proceed from there.


I know this question is already answered but, if you are new to Postgres and seeing similar issues, try the below commands to resolve the error pg_ctl: no database directory specified and environment variable PGDATA unset Try "pg_ctl --help" for more information.

1. su - postgres
2. find / -name pg_ctl --> gives you the location where pg_ctl present, in my case it is there in `/usr/lib/postgresql/11/bin/`
3. /usr/lib/postgresql/11/bin/pg_ctl -D /var/lib/postgresql/11/main
0

精彩评论

暂无评论...
验证码 换一张
取 消