I’m trying to use MSSQL with phoenix framework but when I use mix ecto.create, this error will appear:
14:39:38.695 [error] GenServer #PID<0.5164.0> terminating
** (MatchError) no match of right hand side value: {:error, :econnreset}
(tds 2.3.0) lib/tds/protocol.ex:343: Tds.Protocol.instance/2
(tds 2.3.0) lib/tds/protocol.ex:81: Tds.Protocol.connect/1
(db_connection 2.4.2) lib/db_connection/connection.ex:82: DBConnection.Connection.connect/onnection.Connection.connect/2
(connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Tds.Protocol
** (Mix) The database for Hello.MRepo couldn't be created: killed
This is my devs.exs :
config :hello, Hello.MRepo,
adapter: Tds.Ecto,
hostname: "localhost",
instance: "SERVER",
port: 1433,
username: "sa",
password: "server",
database: "hello_dev_mssql",
show_sensitive_data_on_connection_error: true,
pool_size: 10
And this is my repo :
defmodule Hello.MRepo do
use Ecto.Repo,
otp_app: :hello,
adapter: Ecto.Adapters.Tds
end
The general configuration:
Elixir: 1.13.3
OTP: 24
Phoenix 1.6.6
Thanks!