title: Can't connect to SQL Server in Docker container
body: <p>I can connect to SQL Server in a Docker container using...</p>
  
  <pre><code>Docker exec -it 93fc /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Password$$123
  </code></pre>
  
  <p>But I can't connect if I plug the same details into RazorSQL.</p>
  
  <p>i.e. localhost with SA and Password$$123</p>
  
  <p>What step am I missing?</p>
  
  <p>This is the run command...</p>
  
  <pre><code>Docker run -e 'ACCEPT_EULA=Y' -e SA_PASSWORD=Password$$123 -p 1433:1433 -d microsoft/mssql-server-linux 
  </code></pre>
  
  <p>This is a connection string I've tried from a test running in Visual Studio...</p>
  
  <pre><code>Data Source=localhost;Initial Catalog=master;User=sa;Password=Password$$123;
  </code></pre>
  
  <p>I think it can find the SQL Server but for some reason it can't login with SA.</p>
  
  <p>Even this running from Windows doesn't work...</p>
  
  <pre><code>sqlcmd -S 192.168.10.79,1433 -U SA -P Password$$123
  </code></pre>
  
  <p>This problem goes away if I update the password using...</p>
  
  <pre><code>ALTER LOGIN SA WITH PASSWORD='Pa$$word123'
  </code></pre>
  
  <p>So I can connect to SQL Server inside the container using the initial password and then if I change the password I can connect externally.</p>
  
  <p>How can the password determine if an external connection works?</p>
  
  <p>If I enter <code>env</code> in the console, I get...</p>
  
  <pre><code>MSSQL_SA_PASSWORD=Password14961123
  </code></pre>
  
  <p>I presume that was auto generated.</p>