mix ecto.create fails

I’m beggining with phoenix. I have a PostgreSQL database with username “postgres” and “root” as password. They are correctly modified in the config/dev.exs file.

However, when I run the “mix ecto.create” command, I have this error :

16:10:29.607 [error] GenServer #PID<0.218.0> terminating
** (RuntimeError) Connect raised a FunctionClauseError error. The exception details are hidden, as
they may contain sensitive data such as database credentials.

(postgrex 0.12.2) lib/postgrex/messages.ex:371: Postgrex.Messages.decode_auth_type/1
(postgrex 0.12.2) lib/postgrex/messages.ex:64: Postgrex.Messages.parse/3
(postgrex 0.12.2) lib/postgrex/protocol.ex:1730: Postgrex.Protocol.msg_decode/1
(postgrex 0.12.2) lib/postgrex/protocol.ex:1704: Postgrex.Protocol.msg_recv/3
(postgrex 0.12.2) lib/postgrex/protocol.ex:426: Postgrex.Protocol.auth_recv/3
(postgrex 0.12.2) lib/postgrex/protocol.ex:353: Postgrex.Protocol.handshake/2
(db_connection 1.1.3) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
(connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Discuss.Repo couldn't be created: an exception was raised:
** (RuntimeError) Connect raised a FunctionClauseError error. The exception details are hidden, as
they may contain sensitive data such as database credentials.

    (postgrex 0.12.2) lib/postgrex/messages.ex:371: Postgrex.Messages.decode_auth_type/1
    (postgrex 0.12.2) lib/postgrex/messages.ex:64: Postgrex.Messages.parse/3
    (postgrex 0.12.2) lib/postgrex/protocol.ex:1730: Postgrex.Protocol.msg_decode/1
    (postgrex 0.12.2) lib/postgrex/protocol.ex:1704: Postgrex.Protocol.msg_recv/3
    (postgrex 0.12.2) lib/postgrex/protocol.ex:426: Postgrex.Protocol.auth_recv/3
    (postgrex 0.12.2) lib/postgrex/protocol.ex:353: Postgrex.Protocol.handshake/2
    (db_connection 1.1.3) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
    (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Do you know why ? My psql credentials are correct…

Check this thread Ecto.create failure out

I reinstalled Phoenix and it works