I've got an app that seems to be running just fine for the most part on Postgres (for Heroku), but now that I'm trying to do some fancier stuff like starting a delayed_job worker with
RAILS_ENV=production script/delayed_job
I get this error:
FATAL: password authentication failed for user "<myusername>" (PG::Error)
This is troublesome, because
Installing postgres was a huge, confusing mess for me, as a Rails newbie, and I never remember setting a password. (I've got a password for PGAdminII, but I know that one, and this isn't it). When I go into my database.yml file and try to change the password to everything I can think of it being, it doesn't work.
Fishing around on the internet, it looks like I should do something to a pg_hba.conf file, but I don't have one anywhere, apparently.
I've been working on this app for weeks, and I really don't want to erase what I've got going on, so I'm wary of initdb'ing in another directory.
Database stuff makes no sense to me. I've tried to figure it out, but I think I'm just too new to this stuff. And I never know where to start to fix things.
This question is sort of vague cause I don't know enough to know what specific question to ask -- but can can anybody help me with this? Like: How do I figure out my password? What do I do about pg_hba.conf? Will I have to start a new database?
EDIT -- Per the below suggestions (Thanks!), I ran both "ps -A | grep postgres" and "ps -A | grep pg_ctl". The output of each, respectively, is
85 ?? 0:06.94 postgres: logger process
101 ?? 0:32.04 postgres: writer process
102 ?? 0:23.98 postgres: wal writer process
103 ?? 0:06.70 postgres: autovacuum launcher process
104 ?? 0:07.60 postgres: stats collector process
6337 ttys002 0:00.01 grep postgres
and
6340 ttys002 0:00.00 grep pg_ctl
neither of which, unfortunately, appears to have anything preceded by -D.
I can find my pg_hba.conf file in the path:
/etc/postgresql/9.1/main/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.