Skip to content
Microsoft SQL Server

SQL Server Error 18461

Login failed: server is in single user mode

Severity 14 Logins & Permissions
Applies to: All supported SQL Server versions (2016 to 2025); not applicable to Azure SQL Database or Azure SQL Managed Instance
Last technically reviewed 24 October 2026 on SQL Server 2025 (17.0.1145.4)
The full message
Login failed for user 'CONTOSO\dba'. Reason: Server is in single user mode. Only one administrator can connect at this time.
Error number
18461
Severity
14 (user-correctable error)
State
Not documented by Microsoft (not reproduced here)
Product
Microsoft SQL Server Database Engine
Versions
All supported SQL Server versions (2016 to 2025); not applicable to Azure SQL Database or Azure SQL Managed Instance
Last reviewed
24 October 2026

What it means

Error 18461 means the whole SQL Server instance was started in single-user mode (startup option -m) and its one allowed connection is already taken, so your login was refused.

Starting SQL Server with the -m startup option puts the instance in single-user mode: only one connection, by a member of the sysadmin role, is accepted. It is used for recovery work such as restoring master or regaining access when no administrator can log in. Any further connection fails with 18461 at severity 14 while that one session exists. The password and the login are fine; the slot is simply taken.

Very often the slot is taken by something other than you: SQL Server Agent (Microsoft says to stop it first for exactly this reason), a monitoring tool or an application service, or on a failover cluster the cluster resource DLL. Object Explorer in SQL Server Management Studio can also fail or get in the way because it needs more than one connection. This is different from a database in SINGLE_USER mode, which affects one database only and fails with other errors (for example error 4060 when the connection names that database).

Common causes

  • An administrator started the service with -m (or -f, minimal configuration, which also implies single-user mode) for maintenance, and someone else connected first.
  • SQL Server Agent, a monitoring agent or an application service connected as soon as the instance came up and holds the only connection.
  • On a failover cluster instance, the cluster resource DLL uses the only connection (Microsoft documents a separate procedure for clusters).
  • The -m parameter was left in the startup parameters after maintenance, so the instance keeps starting in single-user mode.

Diagnose it

Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.

Is the instance in single-user mode?

Run from the session that holds the connection, or after a normal restart to confirm.

SELECT SERVERPROPERTY('IsSingleUser') AS is_single_user;
What to look for

1 means the instance runs in single-user mode. 0 means normal (multi-user) mode, so look at the database instead.

Who holds the connection?

SELECT session_id, login_name, host_name, program_name, login_time
FROM sys.dm_exec_sessions
WHERE is_user_process = 1;
What to look for

The program_name identifies the client that won the race, for example SQL Server Agent or a monitoring tool. That is the program to stop.

Are -m or -f in the startup parameters?

SELECT value_name, value_data
FROM sys.dm_server_registry
WHERE value_name LIKE N'SQLArg%';
What to look for

A value of -m (possibly followed by a client name) or -f means the instance will start in single-user mode every time until it is removed.

How to fix it

Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.

Stop the program that took the connection

Client or network side

Stop SQL Server Agent and any monitoring or application services that connect automatically, then connect with sqlcmd or a single Query Editor window in SQL Server Management Studio (not Object Explorer).

Restrict single-user mode to one client program

Changes configuration

Microsoft documents that -m can be followed by a client application name, so that only that program may take the connection. For a default instance, from an elevated command prompt: net stop MSSQLSERVER, then net start MSSQLSERVER /m"SQLCMD", then connect with sqlcmd -S . -E. Other programs are then rejected. Microsoft warns that the application name is supplied by the client, so this is a convenience, not a security control.

Caution: Stopping the service disconnects every user and stops every application that uses the instance. Do it only in a planned maintenance window, and restart without -m when you are done.

Return the instance to multi-user mode

Changes configuration

When the maintenance is finished, remove -m or -f from the startup parameters (SQL Server Configuration Manager, service properties, Startup Parameters) and restart the service normally.

Caution: A restart disconnects all sessions. Make sure the maintenance work that needed single-user mode is complete first.

Examples

A second connection while the instance runs with -m

Shown as documented by Microsoft (sys.messages and the single-user mode articles), not reproduced: restarting the lab instance in single-user mode is not allowed. The login name is an example.

-- The service was started with: net start MSSQLSERVER /m
-- SQL Server Agent connected first. A second connection then fails:
-- sqlcmd -S . -E -Q "SELECT 1"
Result
Login failed for user 'CONTOSO\dba'. Reason: Server is in single user mode. Only one administrator can connect at this time.

How to prevent it

Use single-user mode only for the recovery tasks that need it, always with a client name after -m, and with SQL Server Agent and other services stopped beforehand. Write the steps down, including removing the startup parameter and restarting normally at the end.

For routine work on one database, set only that database to SINGLE_USER or RESTRICTED_USER instead of the whole instance. If the goal is to regain sysadmin access, follow Microsoft's procedure for when system administrators are locked out.

Common questions

I started SQL Server in single-user mode and cannot connect. Why?

Another program took the only connection first, often SQL Server Agent. Stop those, or restart with -m followed by the client name (for example -m"SQLCMD") so only that program can connect.

Is 18461 the same as a database in SINGLE_USER mode?

No. 18461 is about the whole instance started with -m. A database set to SINGLE_USER only blocks connections to that database and returns different errors.

How do I get out of single-user mode?

Remove -m (or -f) from the startup parameters and restart the SQL Server service normally. There is no T-SQL command that switches the instance back while it is running.

Learn more on CodeWithSQL

Official documentation

Last technically reviewed 24 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.

Still stuck on a SQL Server error?

Browse the full SQL Server error library, or get hands-on help from an experienced SQL professional.