21

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.

2

5 Answers 5

29

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

1
8
  • 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.

1
  • 1
    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
    Commented Sep 8, 2019 at 12:28
4

it worked for me only when i started service using command line

net start <service> /mSQLCMD

then

sqlcmd -S. -E
3
  • 3
    How does your answer differ from the previous answer(s) given? It's an iteration of a previous answer, but just written out as an example.
    – John K. N.
    Commented Aug 6, 2020 at 13:39
  • my answer is different. It worked for me only this way
    – Ben
    Commented Aug 7, 2020 at 14:24
  • Although it makes no sense... I am in the same boat as Ben. It only worked for me this way and I attempted to configure the single user mode start umpteen different ways. Commented Jul 22, 2021 at 19:15
-2

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.

-2

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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