Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to server on custom port #163

Open
general-albatross opened this issue Feb 10, 2018 · 6 comments
Open

Unable to connect to server on custom port #163

general-albatross opened this issue Feb 10, 2018 · 6 comments

Comments

@general-albatross
Copy link

Hi,

I`m having problems with connecting to SQL Server On Linux using mssql-cli using Ubuntu 16.04.
This is not related to firewall etc, as connection from same machine using mssql tool works fine.

Steps to reproduce:

  1. setup sql server on port different than 1433
  2. try to connect using following command:
    mssql-cli -S HOST,PORT

Expected result:
Successful connection

Actual result:
Connection did not succeed. Error message: Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=111; handshake=363; [Login] initialization=4; authentication=8; [Post-Login] complete=14033;

@chriswolf-nrg
Copy link

This works for me:

$ mssql-cli -S "tcp:someserver.domain.net,1435" -U someuser

You should make sure to prefix with tcp: and have the whole protocol:host,port in quotes.

@LeeiFrankJaw
Copy link

I have the same problem.

mssql-cli -S 'server,port -d 'dbname' -U 'username' -P 'password'

The above command gives the following error message.

Error message: Connection Timeout Expired.  The timeout period elapsed during the post-login phase.  The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=34; handshake=154; [Login] initialization=3; authentication=6; [Post-Login] complete=14018;

The standard sqlcmd can connect to server without any problem.

sqlcmd -S 'server,port -d 'dbname' -U 'username' -P 'password'

I also tried what @chriswolf-nrg suggests by adding a protocol prefix
tcp, but to no avail, it doesn't work.

mssql-cli -S 'tcp:server,port -d 'dbname' -U 'username' -P 'password'

The above command gives the same error message as that of first
command.

@chriswolf-nrg
Copy link

The version that works for me is 0.13.0. I should also mention that my environment is WSL (Windows Subsystem for Linux) with Ubuntu 16.04.2. https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux

@LeeiFrankJaw
Copy link

My mssql-cli version is also 0.13.0, but I ran it under a true Linux environment (Ubuntu 16.04.4 LTS). The standard command sqlcmd works but mssql-cli doesn't. This really indicates a problem with mssql-cli.

@Blackbaud-JasonBodnar
Copy link

I have the same issue with 0.15.0.

@mdavis-xyz
Copy link

It works for me with that comma separation (even without double quotes).

The issue I had is that a comma separator is not intuitive. I first assumed there was some other flag (-P? Nope, that's password), then I tried host:port.

I think this needs to be documented. PR #522 does that. (But it hasn't been merged, and I don't know why.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants