Installed Postgresql via Homebrew. I wanted to create a new database after unzipping a ".tar". But I have this problem.
Michael-Adelekes-MacBook:wikiful madeleke13$ sudo su postgres -c 'createuser-P--superuser madeleke13'
bash: createuser-P--superuser: command not found
Michael-Adelekes-MacBook:wikiful madeleke13$ sudo su postgres -c 'createuser-P-superuser madeleke13'
bash: createuser-P-superuser: command not found
Michael-Adelekes-MacBook:wikiful madeleke13$ sudo su postgres -c 'createuser -P --superuser madelek13'
Password: Enter password for new role: Enter it again:
Michael-Adelekes-MacBook:wikiful madeleke13$ createdb -T template0
newdbPassword:
Password:createdb: could not connect to database template1: FATAL: password authentication failed for user "madeleke13"
Michael-Adelekes-MacBook:wikiful madeleke13$
I am not understanding why I'm unable to authenticate my username when I have had no problems before.
pg_hba.conf
rules are such that a random user has to provide a password to connect to a database. Edit it to usetrust
as the authentication method if you want passwordless connections. – Daniel Vérité