问题
I installed postgresql on my Mac through homebrew. It said it didn't create a postgres account, but is using an account with my username instead. However, running the command psql fails because when I type in my password, it says it's wrong. I've retried it to make sure I'm not typing it wrong. So what's the password it gave me?
回答1:
There are two different "accounts" here:
The OS X user that owns the PostgreSQL files and processes. When you installed PostgreSQL, you used your own user account for that.
The PostgreSQL user that can log in to the PostgreSQL database. By default, that user is internal to your PostgreSQL instance and has nothing to do with any OS X user.
For psql, you need #2. Immediately after installation, there should be a user named "postgres" with no password that has full administrative privileges - try logging in with those credentials (and change the password to something secure ASAP).
来源:https://stackoverflow.com/questions/23769579/default-password-for-my-user-in-postgresql