新的Phoenix 1.4项目上的MySQL连接错误

时间:2019-02-13 23:21:07

标签: mysql elixir phoenix-framework

我试图在Macbook Pro上使用mysql设置一个全新的phoenix 1.4项目,但在mix ecto.create上遇到了此错误

> mix phx.new vernal --database mysql

(然后我在config / dev.exs上设置根用户名和密码)

> mix ecto.create

15:05:33.863 [error] GenServer #PID<0.223.0> terminating
** (RuntimeError) connect raised FunctionClauseError exception.The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true if you wish to see all of the details
    (mariaex) lib/mariaex/protocol.ex:1092: Mariaex.Protocol.password/3
    (mariaex) lib/mariaex/protocol.ex:212: Mariaex.Protocol.handle_handshake/3
    (mariaex) lib/mariaex/protocol.ex:171: Mariaex.Protocol.handshake_recv/2
    (db_connection) lib/db_connection/connection.ex:66: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
State: Mariaex.Protocol
** (Mix) The database for Vernal.Repo couldn't be created: %RuntimeError{message: "killed"}

我的环境:

macOS Sierra(版本10.12.6)

mysql --version
mysql  Ver 8.0.11 for macos10.13 on x86_64 (MySQL Community Server - GPL)

使用相同的root用户名和密码,我可以在终端中成功启动mysql,MySQL Workbench也可以正常运行,它表明它在端口3306上运行,并且可以进行查询并执行查询,因此我认为应该正确安装MySQL

iex --version
Erlang/OTP 21 [erts-10.2.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

IEx 1.8.0 (compiled with Erlang/OTP 21)

mix phx.new --version
Phoenix v1.4.0

mix.lock has "mariaex": "0.9.1"

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

有人还在检查吗?

https://github.com/elixir-ecto/myxql

是适用于MySQL V8的软件包

def deps() do
 [
   {:myxql, "~> 0.4.0"}
 ]
end