Can't access an SQL instance locally on the server

Tony Mourad 81 Reputation points
2023-02-09T20:02:40.7666667+00:00

Hi to all, i am toni, i am a system engineer but right now i am playing a role of db admin inside the company because our dbadmin left :).i have a windows server 16 where sql server 2016 installed on it. 5 instances exist on the server all working fine except one instance, i can't access to it using a credentials provided by the ex dbadmin. I am trying to access the instance locally from the server using sql management studio. When trying to access i got the below error A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (Microsoft SQL Server, Error: 64) right now i am not able to access the instance, the maintenance plan failed daily and i am not able to do anything. Can you advise please about the error message above and why i am not able to access it. Thanks and regards,

Windows for business Windows Server User experience Other
SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-02-11T19:49:02.6066667+00:00

    Hi, i saw on event viewer that the connection allowed to this instance is 5, i guess maybe this is the problem.

    Yes, exceeding that setting produces exactly that error message; I just tested.

    Thankfully, there is an easy way to resolve the issue. When you connect to the server, prepend ADMIN: to the server name. This will log you in on the admin connection, which does not count against that configuration setting. You may still get an error when you connect, because SSMS may try to set up a second connection for Intellisense, but that will not work out. (Because there can only be one session on the Admin connection.)

    Once you are connected, you can run

    EXEC sp_configure 'user connections', 0
    RECONFIGURE WITH OVERRIDE
    

    You need to restart SQL Server for the change to take effect.

    Of course, it is an interesting question, why the setting is set to five. Normally, you should not touch this setting, as SQL Server controls this itself. And 5 is a ridiculously low number. One reason I can think of is that there is a third-party software running on this machine, and the setting is there to enforce a license of five users.

    I have a question, as the backup maintenance plan failed on this instance and can't check it as i can't access the instance, so i stop the services of the instance and i copy the mdf and ldf files to another location. Can i consider this method as backup until i resolve the login issue?

    Yes, that works. But you could also use the ADMIN connection in the maintenance job.

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. ERIC MILA 5 Reputation points
    2023-02-09T21:27:25.3033333+00:00

    Hi Toni,

    How do you connect : with Active Directory rights or SA account ?

    Have you tried from your device ? or the device of your old DBADMIN.

    Maybe :

    • the user account of you old DBADMIN was Admin of SQL SERVER and other standard account are disable.
    • a restriction of client or Ip adresses to manage SQL SERVER is implemented

    About the maintenance plan, see Windows services for SQL Server. You can find something.

    I hope bring some help to you

    Regards


  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-02-09T22:35:18.0366667+00:00

    Open SQL Server Configuration Manager. There are two things to check here. One is the node SQL Server Network configuration. Check that Shared Memory is enabled:

    User's image

    Shared memory is what you expect to be used for a local connection, but the error message talks about TCP.

    Then go the Services node, and find the instance in question. Double-click it and go to the StartUp parameters tab and select theh -e option:

    User's image

    The argument for this option gives you the location to the errorlog for this instance. This file may include messages that are related to the login failures.


  3. LiHongMSFT-4306 31,566 Reputation points
    2023-02-10T03:15:00.86+00:00

    Hi @Tony Mourad

    Some workarounds:

    • Try to set TrustServerCertificate=True in your connection string. See: Breaking Changes
    • Make sure that TCP/IP is enabled as a client protocol on the application server and in case of issue try upgrading to/enabling TLS 1.2 else to tls 1.0
    • Check the port number to be 1433 and make sure the server name is fully qualified in the connection string.
    • Try increasing the connection time out to a larger value.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.