Docker: cannot connect to SQL Server

I tried to run the Docker as described 
docker run --rm redgate/sqlcompare:14 /IAgreeToTheEULA /s1:my-server\\sql2019 /db1:database1 /u1:sa /p1:my-password  /s2:my-server\\sql2019 /db2:database2 /u2:sa /p2:my-password
In that case my SQL Server located in the LAN on the server

But receive the error:
Error: 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: SQL Network Interfaces, error: 25 -
Connection string is not valid)

What I am doing wrong? 
Tagged:

Answers

  • Sergio RSergio R Posts: 610 Rose Gold 5
    edited September 2, 2020 1:50PM
    This appears to be a connection issue, it might be worth trying to use the IP address in place of the server name in s1 and s2.
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • I have checked
    >ping my-server
    192.168.0.101

    and run 
    docker run --rm redgate/sqlcompare:14 /IAgreeToTheEULA /s1:192.168.0.101\\sql2019 /db1:database1 /u1:sa /p1:my-password  /s2:192.168.0.101\\sql2019 /db2:database2 /u2:sa /p2:my-password

    Error: 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: SQL Network Interfaces, error: 25 -
    Connection string is not valid)


  • acastacast Posts: 4 New member

    There might be an issue with the command syntax or options. The double backslashes (\\) in the server names may not be necessary, and make sure the SQL Server instance names, databases, and credentials are accurate. Also, the SQL Server must be configured to allow remote connections.

    Here's a modified version of your command with some adjustments:

    docker run --rm redgate/sqlcompare:14 /IAgreeToTheEULA /s1:192.168.0.101\sql2019 /db1:database1 /u1:sa /p1:my-password /s2:192.168.0.101\sql2019 /db2:database2 /u2:sa /p2:my-password

    Note that I changed \\ to just \ in the server names.

  • acastacast Posts: 4 New member

    There might be an issue with the command syntax or options. The double backslashes (\\) in the server names may not be necessary, and make sure the SQL Server instance names, databases, and credentials are accurate. Also, the SQL Server must be configured to allow remote connections.

    Here's a modified version of your command with some adjustments:

    docker run --rm redgate/sqlcompare:14 /IAgreeToTheEULA /s1:192.168.0.101\sql2019 /db1:database1 /u1:sa /p1:my-password /s2:192.168.0.101\sql2019 /db2:database2 /u2:sa /p2:my-password

    Note that I changed \\ to just \ in the server names.

  • acastacast Posts: 4 New member

    There might be an issue with the command syntax or options. The double backslashes (\\) in the server names may not be necessary, and make sure the SQL Server instance names, databases, and credentials are accurate. Also, the SQL Server must be configured to allow remote connections.

    Here's a modified version of your command with some adjustments:

    docker run --rm redgate/sqlcompare:14 /IAgreeToTheEULA /s1:192.168.0.101\sql2019 /db1:database1 /u1:sa /p1:my-password /s2:192.168.0.101\sql2019 /db2:database2 /u2:sa /p2:my-password

    Note that I changed \\ to just \ in the server names.

Sign In or Register to comment.