I just started Elixir Phoenix new web app with:
mix phoenix.new phoenix_sample --database mssql
It generated config/dev.exs file with db configuration, I have modified to match my current ms sql server:
config :phoenix_sample, PhoenixSample.Repo,
adapter: Tds.Ecto,
username: "dev",
password: "dev",
database: "phoenix_sample_db",
hostname: "localhost",
pool_size: 10
I am able to login into ssms as dev user and connect to phoenix_sample_db database
But when I run: mix ecto.create
I always error out:
** (EXIT from #PID<0.46.0>) %Tds.Error{message: "tcp connect: nxdomain", mssql: nil}
17:44:04.805 [error] GenServer #PID<0.274.0> terminating
** (stop) %Tds.Error{message: "tcp connect: nxdomain", mssql: nil}
Last message: {:connect, [port: 1433, hostname: ".", database: "master", otp_app: :phoenix_sample, repo: PhoenixSample.Repo, adapter: Tds.Ecto, username: "dev", password: "dev", pool_size: 10]}
State: %{attn_timer: nil, env: %{trans: <<0>>}, ireq: nil, itcp: nil, opts: [port: 1433, hostname: ".", database: "master", otp_app: :phoenix_sample, repo: PhoenixSample.Repo,
adapter: Tds.Ecto, username: "dev", password: "dev", pool_size: 10], pak_data: "", pak_header: "", queue: {[{{:connect, [port: 1433, hostname: ".", database: "master", otp_app: :phoenix_sample, repo: PhoenixSample.Repo, adapter: Tds.Ecto, username: "dev", password: "dev", pool_size: 10]}, {#PID<0.46.0>, #Reference<0.0.2.504>}, #Reference<0.0.2.505>}], []}, sock: nil, state: :ready, statement: nil, tail: "", usock: nil}
Why it's not working and why ecto trying to connect to master db?
If ecto trying to create new database then I need to pass sa credentials to db user config?

