Can't connect to remote mssql server

8,363

As the error message tells you, the problem is not the firewall or the remote connections, but the login process.

Since you're connecting from PHP, try password authentication instead of Windows Authentication (note that by default, password authentication is disabled for Microsoft SQL Server). PHP with Windows Authentication may be a pain, at least it was a few years ago when I tried to make it work, wasted a few days and never achieved to make it work.

If you're already using password authentication, check that it is enabled in Microsoft SQL Server itself.

If this doesn't help:

  • Check the Microsoft SQL Server logs. Sometimes, they contain interesting stuff when the authentication is not working for an obscure reason.

  • Some advise to check whether Shared Memory, Named Pipes and TCP/IP are all enabled, so check this one too (in SQL Server Configuration Manager).

  • Make sure to read the article by Pinal Dave.

Share:
8,363

Related videos on Youtube

Dylan Dodds
Author by

Dylan Dodds

Updated on September 18, 2022

Comments

  • Dylan Dodds
    Dylan Dodds over 1 year

    I'm trying to connect to my remote mssql server for my GunZ private server, but for some reason i get the following error


    Cannot connect to 94.xx.xx.xx.


    ADDITIONAL INFORMATION:

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)

    I pinged the port using an online port checker it said the port was open. The Service is running The firewall is disabled(since the system is on a virtual machine) and tcp/ip has been enabled in the configuration manager allow remote connections is enabled Listen all is enabled

    • Zero
      Zero about 11 years
      What version is the client version that you are using and what version of SQL is the server using? If your client is behind compared to the server it does produce this type of error.
  • Dylan Dodds
    Dylan Dodds about 11 years
    i am connecting with password authentication and I am getting this error trying to connect from SSMS 2008 the php code is just not connecting
  • Arseni Mourzenko
    Arseni Mourzenko about 11 years
    Make sure password authentication is enabled in Microsoft SQL Server.
  • Dylan Dodds
    Dylan Dodds about 11 years
    that's how I usually connect through the local host So it should already be enabled from installation
  • Dylan Dodds
    Dylan Dodds about 11 years
    some tutorials are telling me to add \SQLEXPRESS (my server name) to the end of my tags but if I do it gives me this error instead :: 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)