I created a phoenix project from the hello example using digital ocean. I entered the username and password from the etc/motd.tail file. I keep getting the error message below. I am a beginner and for some reason I just cannot get ecto to install correctly.
** (Mix) The database for Hello.Repo couldn't be created, reason given: psql: FATAL: password authentication failed for user "elixir" FATAL: password authentication failed for user "elixir"
You can use the following Postgress database credentials: * User: elixir * Pass: ***
install. Any help would be appreciated.
Restart the PostgreSQL service from the Services control panel ( start->run->services. msc ) Connect using psql or pgAdmin4 or whatever you prefer. Run ALTER USER postgres PASSWORD 'fooBarEatsBarFoodBareFoot'
For most systems, the default Postgres user is postgres and a password is not required for authentication.
SCRAM supports storing passwords on the server in a cryptographically hashed form which provides advanced security. To access the PostgreSQL database server using SCRAM method of authentication, your client libraries need to support SCRAM. Refer to the list of drivers that support SCRAM.
I get the same error using Ubuntu 14.04 and I corrected resetting the 'postgres' password:
$ sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
and restart postgres service:
sudo service postgresql restart
I assume this error is happening on the mix ecto.create
task?
This happens because Ecto uses psql
to create the database, however this is no longer the case in the upcoming Ecto 2.0.
The following GitHub issue shows the same issue https://github.com/elixir-lang/ecto/issues/1207
The relevant comment with the fix is https://github.com/elixir-lang/ecto/issues/1207#issuecomment-172570064:
My database config (pg_hba.conf) was apparently wrong.
For anyone else encountering this:
host all my_user 127.0.0.1/32 trust will not work host all my_user localhost trust will work
Please check your pg_hba.conf
(likely in /etc/postsgresql/9.x/pg_hba.conf
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With