简体   繁体   中英

SQL connection error using visual studio code mssql extension on macOS

I am currently developing an ASP.NET app using Visual Studio Code on mac. I am trying to use "mssql extension" to get connection with a SQL Server database.

I followed https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-develop-use-vscode step by step. However, I always get an error message like below:

mssql: Failed to connect: System.Data.SqlClient.SqlException: 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: 40 - Could not open a connection to SQL Server)

"error message screenshot"

Thanks for your help in advance.

If this is a SQL Server 2008 R2 instance, you need to upgrade to SP3. See https://github.com/Microsoft/vscode-mssql/issues/666 for details - basically .Net Core doesn't support older versions due to a vulnerability that is fixed in SP3, and the MSSQL extension uses the .Net Core stack for connectivity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM