Search code examples
postgresqlmacoshomebrewdatabase-administration

PostgreSQL on Mac doesn't recognize users password


I have tried numerous suggestions from other posts and SO questions but none seem to do the trick. I just installed PostgreSQL with brew install, then ran the initdb command. The output said the user would be used for the DB, however, the user is always displayed as the mac user. What might I be missing?

output from console:

createdb: could not connect to database template1: FATAL: password authentication failed for user "macuser" 
Users-MBP:~ macuser$ 

Solution

  • Just delete installed postgresql by doing below.

    Remove previous versions of PostgreSQL brew uninstall --force postgresql Delete all Files of Postgres rm -rf /usr/local/var/postgres

    Download macOS packages from Postgresql and install it.

    https://www.postgresql.org/download/macosx/

    Default user will be postgres and password field will be required when install