0

I installed MS SQL Express 2016 edition and when I log in it, it gave me following error.

TITLE: Connect to Server
------------------------------

Cannot connect to 192.168.50.173\KONSYS.

------------------------------
ADDITIONAL INFORMATION:

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: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

SQL Server also running and it can see in services.

I also add rules for 1433 and 1434 ports in Windows Firewall.

How to solve this problem

2
  • Have you also added a rule for sqlsrv.exe placed in the Binn folder? Commented Aug 31, 2018 at 9:32
  • Open SQL Server error log, in one of the first rows you'll find the effective port number
    – sepupic
    Commented Aug 31, 2018 at 10:12

1 Answer 1

1

SQL Server Named instances by default are running on a dynamic TCP/IP port (so it won't be default 1433). You can try to do a few things to enable access to your instance (assuming that Firewall is configured properly).

SQL Server Browser

You need to ensure that the SQL Server Browser service is running.

  1. Open SQL Server Configuration Manager
  2. Go to SQL Server Services
  3. Right-click on SQL Server Browser service
  4. Click Start

enter image description here

Try to connect to your instance providing <hostname>\<instancename> or <IP>\<instancename> as Server Name. If that doesn't help go to the next step.

TCP\IP Protocol

To enable TCP\IP protocol for your instance:

  1. Open SQL Server Configuration Manager
  2. Go to SQL Server Network Configuration
  3. Go to Protocols for
  4. Right-click on TCP/IP
  5. Click Enable
  6. Restart your SQL Server instance

enter image description here

If you want to use a static port for your instance (instead of dynamic that changes after every restart) you can change it here.

  1. Open Properties for TCP/IP protocol
  2. Go to IP Addresses tab
  3. Scroll down to IPAll section
  4. Remove 0 value from TCP Dynamic Ports
  5. Specify your port in TCP Port

enter image description here

You can use this port to connect to your instance by providing <servername>,<port> or <IP>,<port> as Server Name (yes, there is a comma, not a colon).

Not the answer you're looking for? Browse other questions tagged or ask your own question.