Trying to install PostgreSQL with Ruby on Rails with Nginx on CentOS 6.5 using the following guide: http://karolgalanciak.com/blog/2013/07/19/centos-6-4-server-setup-with-ruby-on-rails-nginx-and-postgresql/
After install I went to configure the user, so issued command sudo su postgres
then psql
. When I do this, I get the following error:
could not change directory to "/root": Permission denied
psql (9.3.4)
Ignoring this, I issued the command:
alter user postgres with password 'postgres-user-password';
Then I went to change the auth method to md5 dy doing:
sudo vi /var/lib/pgsql/9.3/data/pg_hba.conf
When I do this I am shown the prompt:
[sudo] password for postgres:
No matter what password I enter, I'm told Sorry, try again.
even though the password is exactly the one I just set.
Tried following instructions from this post by user716468, but no luck: What's the default superuser username/password for postgres after a new install?
When I do sudo -u postgres psql postgres
I'm told:
postgres is not in the sudoers file. This incident will be reported.
You have new mail in /var/spool/mail/root
What is wrong here?