WSL Ubuntu 20.04: TCP Provider Error: 40 Cannot establish connection.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 191
- PR merge metrics
- No merged PRs in 30d
Description
I'm currently hunting down an error with `mssql-cli` on WSL2 running Ubuntu 20.04 where I am unable to connect to an external (Azure hosted) database. I do have Docker Desktop installed and am using the WSL2 integrations.
- I have tested connections to this database with the old `sqlcmd` utility inside WSL, and that works correctly.
- I can connect to the database using the Azure Data Studio on Windows.
- I have installed `mssql-cli` via pip to windows directly, and that works correctly.
- There does not seem to be a version of mssql-cli available in the microsoft repo for 20.04.
- Attempting to `apt install mssql-cli` from the 18.04 source causes multiple package version misalignments, so that's no viable.
- Pip installed `mssql-cli` will not connect.
Attempts to connect end up with the following error, after a few minutes of it's not responding:
```
Error message: 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)
```
Command to start connection is in the form below:
`mssql-cli -S "Server.database.widnows.net,1433" -U Username -P password`
I'm also getting the same error inside a C# project running in WSL, which is what led me to testing connection with `mssql-cli`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.