** (Mariaex.Error) tcp connect: econnrefused - How to connect ecto to MYSQL DB in Vagrant?

Hello, please I’m having issue connecting ecto to a MYSQL db inside vagrant.

I’m on a mac and I have a vagrant setup (Linux, MYSQL, PHP).

I have elixir setup on the host machine.

I want my to connect my phoenixapp to the MYSQL db on the vagrant. Below is my configuration in dev.exs

config :product, Product.Repo,
  adapter: Ecto.Adapters.MySQL,
  username: "root",
  password: "testpassword",
  database: "testdb",
  hostname: "localhost",
  pool_size: 10

The bind-address: on the MYSQL. I’ve changed the hostname: "localhost" to hostname: "" without any success.

Please how can i fix this issue.

Thanks in advance.

I found the solution. This link https://github.com/elixir-ecto/postgrex/issues/313 gave me the hint.