凤凰:混合 ecto.create 失败

时间:2021-01-14 15:25:56

标签: elixir phoenix-framework

我开始使用凤凰。我有一个 PostgreSQL 数据库,用户名“postgres”和“root”作为密码。 它们在 config/dev.exs 文件中被正确修改。

但是,当我运行“mix ecto.create”命令时,出现此错误:

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

你知道为什么吗?我的 psql 凭据是正确的...

1 个答案:

答案 0 :(得分:-1)

我重新安装了 Phoenix 并且可以运行