Tuesday, June 16, 2009

Could not connect to SQL Express 2008

Have connection problem accessing SQL Express 2008? Try following:

  1. Check SQL Server network configuration for the installed instance: ensure TCP/IP protocol is enabled, activated and listens to the port 1433. Restart SQL service after each change in service/network configuration.
  2. Try to connect to installed instance locally using osql.exe (to find in %Program Files%\Microsoft SQL Server\100\Tools\Binn):
    osql -S localMachineName -E
    or
    osql -S localMachineName\instanceName -E
  3. Does it work? Try the same from remote machine (i. e. from the client where you experienced connection problems).
  4. Connection timed out on login? Or another message like "Connection string invalid"? Return to the SQL Express machine and check the firewall settings.
  5. Ensure firewall rules allow port 1433 as exception.
  6. Ensure firewall rules allow sqlservr.exe as exception: ensure the path is %Program Files%\Microsoft SQL Server\MSSQL10.\MSSQL\Binn\sqlservr.exe
  7. Check firewall rules on the client: at least the port 1433 should be allowed.
  8. Retry the connection: does it work now? My client can connect now - and yours?
Do not ask me, why the SQL Express 2008 doesn't configure automatically firewall exceptions: neither during setup nor while perform SQL servic configuration. It is so...

Enjoy!

No comments: