SQL Network Interfaces, error: 25 - Connection string is not valid in Powershell

后端 未结 6 621
天命终不由人
天命终不由人 2021-01-12 10:36
$SQLconnection = New-Object System.Data.SqlClient.SqlConnection
$SQLconnection.ConnectionString = \"Server = MySQLservername\\MSSQLSERVER; Database = \"MYSQLDB\"; In         


        
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-12 11:24

    I had the same error and changed appsettings.json to

    "DefaultConnection": "Server=localhost; database=my-vue-starter-new;MultipleActiveResultSets=true;User Id=SA;Password=myPassword;"
    

    important on linux the server is localhost and the Id automatically became SA

    for more info: https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver15

    another thing may cause to gthat issue if you didn't configure mssql, enabled the tcpport to 1433 if not do it and try to connect again.

提交回复
热议问题