@DailyDDose

MSSQL on Linux?

При попытке выполнения миграции
dotnet ef database update
Вываливается ошибка:
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 работает
alex@alex-ander ~ $ sqlcmd -S localhost -U SA
Password: 
1> use api_dev
2> go
Changed database context to 'api_dev'.

порт 1443 открыт
iptables
alex@alex-ander ~/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


содержимое appsettings.json:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=sqlinux;User Id=SA;Password=UIHt782435Gnalzx;Database=api_dev;Trusted_Connection=false"
  }
}
  • Вопрос задан
  • 212 просмотров
Решения вопроса 1
tsklab
@tsklab Куратор тега SQL Server
Здесь отвечаю на вопросы.
SQL Server is configured to allow remote connections

Включить IP
5a5b83821e750469869168.png5a5b838cae18e133448912.png
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
@DailyDDose Автор вопроса
//closed.
вместо sqlinux нужно было писать localhost.
"DefaultConnection": "Server=localhost;User Id=SA;Password=UIHt782435Gnalzxatabase=api_dev;"

alex@alex-ander ~/Templates/WebApiServer/WebApiServer $ dotnet ef database update 
Applying migration '20180103044038_Initial'.
Done.
alex@alex-ander ~/Templates/WebApiServer/WebApiServer $
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы