13

I was experimenting the effect of giving SQL Server a small amount of memory I thought it was going to recover.

I configured SQL Server to use 200MB of memory now it does not want to start, I did some searches on the internet and I was advised to start SQL Server in single-user mode. however, I get the error

Login Failed for user A. Reason: Server is in single user mode. Only one administrator can connect at this time (Microsoft SQL Server, Error: 18461)

enter image description here

I have stopped the SQL Server Agent.

22

If you start SQL Server in single user mode only one administrator can connect at the same time.

What's probably happening here is that some service is using a sysadmin login to connect such as Reporting services or SQL Server agent.

When starting SQL Server in single user mode you have the option to specify a client application so only that application can connect.

Have a look at the command line options where it lists:

-m "Client Application Name"

When you use the -m option with SQLCMD or SQL Server Management Studio, you can limit the connections to a specified client application. For example, -m"SQLCMD" limits connections to a single connection and that connection must identify itself as the SQLCMD client program. Use this option when you are starting SQL Server in single-user mode and an unknown client application is taking the only available connection. To connect through the Query Editor in Management Studio, use -m"Microsoft SQL Server Management Studio - Query".

Client Application Name is case sensitive.

If you are able to connect this way, change the maximum server memory to something reasonable. I suppose you will be able to connect because otherwise you would probably receive something as "there is no process on the other end of the pipe" so I would assume your server is running.

If however you can't log in to SQL Server because your memory configuration doesn't allow you, you can start SQL Server in minimal configuration using the -f option.

-f

Starts an instance of SQL Server with minimal configuration. This is useful if the setting of a configuration value (for example, over-committing memory) has prevented the server from starting. Starting SQL Server in minimal configuration mode places SQL Server in single-user mode. For more information, see the description for -m that follows.

For reference: SQL Server can’t start after accidently set the "max server memory" to 0

6
  • Start SQL Instance in Minimal configuration mode

    NET START MSSQLSERVER /f
    
  • Connect to the instance from same cmd window and change the Max memory setting :

    SQLCMD -S Server/Instance -E
    

    You should see a prompt that looks like this:

    1> 
    

By default, the maximum memory setting may not be available for viewing and changing. To modify this behavior, use below query:

sp_configure 'show advanced options', 1;  
GO  
RECONFIGURE;  
GO  
sp_configure 'max server memory', 4096;  
GO  
RECONFIGURE;  
GO  

Restart the instance from Configuration Manager.

  • the best solution for <SQL Server can’t start after accidentally set the "max server memory" to 0> and "there is no process on the other end of the pipe" error – faza Sep 8 at 12:28
0

Was able to open query editor window in SSMS after starting SQL Server in single-user mode. See: https://www.sqlservercentral.com/forums/topic/unable-to-open-ssms-in-single-user-mode

  • Linking to the source is good but please consider adding at least the summary of the proposed solution to your answer. That way the answer will remain valid even in case the link becomes dead. – Andriy M Jun 19 at 9:01
-1

I faced a similar issue. I managed to resolve it by stopping "SQL Server (MSSQLSERVER)" and then re-starting it. After restarting the process i was able to connect with no issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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