1

I am encountering issues logging into SQL Server in single-user mode. Here’s the situation:

Single-user mode login issue: When I attempt to log in as the system user, I receive the following message: "Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Server is in single-user mode. Only one administrator can connect at this time." It seems that either someone else is connected or a service is taking up the single available connection.

Disabled user accounts: When I try logging in as my admin user, I get the message "The account is disabled." This suggests that my user account is either disabled or lacks the necessary permissions.

Built-in account limitations: I am logged in as the 'Built-in account,' but I cannot select any other options. It seems my access is restricted, possibly due to the original server setup by my colleague.

Limited account visibility: When logged in with the "reader account," I can only see this account and a disabled 'LegacySysadminLogin.' Additionally, there are other accounts like guest, information_schema, and sys, but they aren't linked to logins.

Master database replacement: I tried replacing the master.mdf file with another one, which allowed me to log in as 'sa' and see more users in the databases. However, I’m not sure if this helps explain the issue.

SQL Server process: I confirmed that only sqlserver.exe is using the port, so no other processes seem to be connected.

Is there a possible way to resolve this issue, or should I seek further assistance from my colleague?

1
  • 2
    When connecting via single-user mode, were you using SQL Management Studio? If so, then this is the problem - SSMS established multiple connections in the background for things like Intellisense. Instead, connect via sqlcmd and fix your personal login, then you should be able to reconnect via SSMS without single-user mode.
    – HandyD
    Commented Oct 23 at 2:47

2 Answers 2

0

Single-user mode login issue: When I attempt to log in as the system user, I receive the following message: "Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Server is in single-user mode. Only one administrator can connect at this time." It seems that either someone else is connected or a service is taking up the single available connection.

You need to use the -m option and assign an application name to your connection string that uniquely identifies you so that no one else can get in but you.

0

You could rule out the possibility that another connection is beating you to it by running the startup and login commands in the same command line script. This will ensure you're first in line.

REM Stop SQL Server Service (Replace MSSQLSERVER with your instance name if not the default)

net stop MSSQLSERVER

REM Start SQL Server in single-user mode and check if the command is successful
net start MSSQLSERVER /m"sqlcmd" && (
    echo SQL Server started in single-user mode.
    
    REM Immediately connect to SQL Server using sqlcmd
    sqlcmd -S . -E
) || (
    echo Failed to start SQL Server in single-user mode.
    exit /b 1
)

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.