【发布时间】:2020-06-21 05:09:31
【问题描述】:
我正在关注https://phoenixframework.readme.io/docs/up-and-running 的 Phoenix Up & Running 指南 当我尝试使用 ecto 创建数据库(Postgresql)时,出现以下错误
mix ecto.create
17:55:35.631 [error] GenServer #PID<0.215.0> terminating
** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as they may contain sensitive data such
as database credentials.
(postgrex 0.12.2) lib/postgrex/utils.ex:40: Postgrex.Utils.parse_version/1
(postgrex 0.12.2) lib/postgrex/protocol.ex:497: Postgrex.Protocol.bootstrap_send/4
(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.11.2) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for HelloPhoenix.Repo couldn't be created: an exception was raised:
** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as they may contain sensitive data such
as database credentials.
(postgrex 0.12.2) lib/postgrex/utils.ex:40: Postgrex.Utils.parse_version/1
(postgrex 0.12.2) lib/postgrex/protocol.ex:497: Postgrex.Protocol.bootstrap_send/4
(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.11.2) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
我发现的唯一建议是更新 Postgrex。我跑了mix deps.update postgrex,但这并没有解决它。
最后我检查了 config/dev.exs 并且用户名/密码设置为“postgres”。我使用 PgAdmin3 确认这是一个有效的登录。
所以在这一点上我被卡住了。
Ubuntu 19.10
postgres (PostgreSQL) 11.7 (Ubuntu 11.7-0ubuntu0.19.10.1)
installed from Ubuntu repo via apt-get
【问题讨论】:
标签: postgresql elixir phoenix-framework ecto