How do I find out what is my database's username
in my local machine? I'm updating my database.yml
file in my rails application, but anything I try isn't working.
When trying to use postgres
(or other options such as mymacusername
) I'm getting the following error:
FATAL: role "postgres" does not exist
Do I need to create it? How? Or can I use an existing username on my computer?
Update:
I am trying to create a user (this is soon after installation so the issue may be that it doesn't exist yet)
I ran createuser -s -U $USER
Name of role to add: postgres
But am getting the following error:
createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
So this is the problem - How do I make it listen to the correct socket?