SQL Server single-user mode starts an instance with room for only one connection, which is useful for certain maintenance and recovery tasks when normal access is blocked. You’ll need administrator rights on the SQL Server computer and a plan to connect using one client only; monitoring tools and background services can take that connection first.
What You’ll Need
- Administrator access to the Windows computer running the SQL Server instance.
- The SQL Server service name, such as the default instance service or a named instance service.
- SQL Server Management Studio (SSMS), sqlcmd, or another client that can connect locally.
- A maintenance window. Single-user mode interrupts normal connections and applications.
- A recent, verified backup if the task could change or repair database files.
Step-by-Step
- Identify the correct instance. Open SQL Server Configuration Manager and check SQL Server Services. Note the exact service name, such as
SQL Server (MSSQLSERVER)for a default instance orSQL Server (INSTANCE)for a named instance. Do not change a different instance by mistake. - Stop applications that connect to the instance. Arrange downtime, then stop application services, scheduled jobs, monitoring agents, and other clients that could reconnect automatically. Close extra SSMS query windows and Object Explorer connections. Single-user mode allows one session, and another process can occupy it before you do.
- Open SQL Server Configuration Manager as an administrator. In Windows, find SQL Server Configuration Manager, right-click it, and choose Run as administrator. If prompted, approve the administrator request. Use this tool rather than editing service settings in an unrelated management console.
- Set a startup parameter. In the left pane, select SQL Server Services. Right-click the service for the intended instance and choose Properties. Open the Startup Parameters tab. In the parameter field, add
-mas a separate startup parameter, preserving any existing entries. Some versions display parameters separated by semicolons; follow the field’s existing format and do not remove other parameters. Click Add if the dialog requires it, then apply the change. - Restart the instance. In SQL Server Configuration Manager, right-click the same service and select Restart. Wait for the service to report that it is running. If it does not start, remove the new parameter or review the SQL Server error log and Windows service events before proceeding.
- Make the one intended connection promptly. Connect locally using SSMS or sqlcmd. For SSMS, choose Database Engine, enter the local server and instance name, select an authentication method you are authorized to use, and connect. Avoid opening multiple connections or Object Explorer if your tool creates separate sessions. With sqlcmd, use the appropriate server name and credentials for your environment; do not put passwords directly into scripts or command history.
- Perform only the planned task. Confirm the connected server and instance before making changes. Run the required maintenance operation, then verify its result. Single-user mode does not grant extra permissions: your login still needs the permissions required for the task.
- Remove single-user mode as soon as you finish. Return to SQL Server Configuration Manager, open the same service’s Properties and Startup Parameters, remove only the
-mentry, apply the change, and restart the service. Confirm normal client access has returned, then restart any application or monitoring services you stopped.
Common Mistakes
- Connecting with more than one session: SSMS Object Explorer, monitoring software, or an application can use the only available connection. Prepare one client and connect directly to the instance.
- Changing the wrong service: A server can host multiple SQL Server instances. Check the service name and target server before changing startup parameters.
- Leaving
-min place: The instance will continue to reject ordinary additional connections after the maintenance task. Remove the parameter and restart. - Assuming single-user mode bypasses permissions: It restricts connections; it does not make a login an administrator or authorize database changes.
- Overwriting existing startup parameters: Add or remove only the intended entry. Keep all existing parameters and their separators intact.
Tips
- Use a maintenance window and tell affected users before restarting the service.
- Stop automatic reconnecting clients first; restarting them while the instance is in single-user mode can lock you out.
- Record the original startup parameters so you can restore them accurately.
- Use the SQL Server error log to confirm startup and diagnose service failures. The log location depends on the instance configuration.
- For a task that requires a particular client application to get the sole connection, SQL Server supports a restricted single-user startup parameter such as
-mSQLCMD. The application name must match the client’s connection application name; verify the exact name for your tool before relying on this option.
Troubleshooting
The service starts, but my connection is refused or says the server is in single-user mode. Another client probably claimed the session. Stop applications, agents, and monitoring tools that may connect, restart the instance if needed, and connect immediately with one client. If you use SSMS, try a direct Database Engine connection without opening Object Explorer first.
The service will not start after adding -m. Reopen the startup-parameter dialog and check that the parameter is separate, correctly written, and that existing entries remain intact. Remove the new entry to restore the prior configuration if necessary. Review the SQL Server error log and Windows event logs for the cause; do not repeatedly restart without checking them.
I cannot find the instance or its properties. Confirm that SQL Server Configuration Manager corresponds to the installed SQL Server components, and verify the Windows service name in the Services list. A named instance has its own service and must be changed separately from the default instance.
The instance remains limited to one connection. Check the Startup Parameters tab for any remaining -m or restricted single-user parameter, remove it, and restart the correct service. Then verify that the instance accepts normal connections.
Frequently Asked Questions
What does SQL Server single-user mode do?
It permits only one user connection to an instance at a time. It is intended for specific administrative tasks, not routine operation.
Does single-user mode give me administrator permissions?
No. Your login must already have the permissions required for the operation.
Can I use SSMS to connect?
Yes, but SSMS may create additional connections. Stop other clients and connect directly with one session; if the session is taken, use a controlled restart and try again.
How do I return SQL Server to normal mode?
Remove the single-user startup parameter in SQL Server Configuration Manager and restart the instance.
Will databases or applications be available during this process?
Normal access is interrupted, and only one connection is permitted while the mode is active. Schedule downtime and restore application services after returning to normal mode.
Can I use single-user mode on a production server?
Only when the maintenance task requires it and downtime is planned. Coordinate with the server owner, protect backups, and minimize the time the instance remains restricted.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- ViewSonic Driver: Find & Install the Right One
- iPhone Camera Won’t Focus? Fix It in 8 Steps
- iPhone Data Recovery: How to Install and Use It
- How to Refill Your Transit Card in Apple Maps
- How to Unlock Phone When Forgot Password
- Fix Bad Sectors in Hard Disk on Windows 10