D
D
DailyDDose2018-01-14 17:33:38
SQL Server
DailyDDose, 2018-01-14 17:33:38

MSSQL on Linux?

When trying to perform a migration
dotnet ef database update
, an error occurs:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)
SQL Server itself is running

[email protected] ~ $ sqlcmd -S localhost -U SA
Password: 
1> use api_dev
2> go
Changed database context to 'api_dev'.

port 1443 open
iptables
[email protected] ~/Templates/WebApiServer/WebApiServer $ sudo iptables -L -n -v
Chain INPUT (policy ACCEPT 1389 packets, 1482K bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:1433

contents of appsettings.json :
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=sqlinux;User Id=SA;Password=UIHt782435Gnalzx;Database=api_dev;Trusted_Connection=false"
  }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2018-01-14
@DailyDDose

SQL Server is configured to allow remote connections

Enable IP
5a5b83821e750469869168.png5a5b838cae18e133448912.png

D
DailyDDose, 2018-01-14
@DailyDDose

//closed.
you should have written localhost instead of sqlinux.

[email protected] ~/Templates/WebApiServer/WebApiServer $ dotnet ef database update 
Applying migration '20180103044038_Initial'.
Done.
[email protected] ~/Templates/WebApiServer/WebApiServer $

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question