Programming Tips - How can I fix: failed FATAL: role "apache" is not permitted to log in

Date: 2013dec17 Product: Postgres, PostgreSQL Q. How can I fix: failed FATAL: role "apache" is not permitted to log in A. These SQL commands fixed it for me:
CREATE USER apache; ALTER USER apache WITH PASSWORD 'the password'; ALTER ROLE apache LOGIN; GRANT ALL ON TABLE mytable TO apache;
Check that /var/lib/pgsql/data/pg_hba.conf the mode is trust