score:4

Accepted answer

This can be a problem due to MSSQL service listening to the localhost. What you can do is to "Change the bind address of MSSQL Service to bind to the Private IP of your EC2 Instance"

To do this, please follow below steps.

  1. Open SQL Server configuration manager and Navigate to "SQL Server Network Configuration" and select "Protocols for MSSQLSERVER"on the left pane
  2. Ensure that TCP/IP protocol is enabled on the right pane
  3. Right Click the "TCP/IP protocol" and select "Properties"
  4. A pop up will open now. In that select "Protocol" tab and ensure that "Listen All" is set to "No"
  5. Go to the "IP addresses" tab for the instance, set "Enabled" to "Yes" and "Port" field corresponding to your "Private IP" of your EC2 Instance to the "1433"
  6. Click "OK" and restart MSSQL Service and try again to connect

More questions