{"id":4097,"date":"2014-10-26T11:00:48","date_gmt":"2014-10-26T11:00:48","guid":{"rendered":"http:\/\/www.top-password.com\/blog\/?p=4097"},"modified":"2014-10-26T11:06:10","modified_gmt":"2014-10-26T11:06:10","slug":"2-methods-to-start-sql-server-in-single-user-mode","status":"publish","type":"post","link":"https:\/\/www.top-password.com\/blog\/2-methods-to-start-sql-server-in-single-user-mode\/","title":{"rendered":"2 Methods to Start SQL Server in Single User Mode"},"content":{"rendered":"<p><strong>What is single-user mode?<\/strong><\/p>\n<p>There are certain situations when user may have to start a SQL Server instance in single-user mode. For example, you might need to restore your master database from a backup in the event of a failure or damage, detach the database and kill all the connections. Both actions require starting an instance of SQL Server in single-user maintenance mode.<\/p>\n<p>When a database is started in single-user mode, the following events occur:<\/p>\n<ul>\n<li>Any current connections to the database are dropped without warning<\/li>\n<li>Only one user can connect to the database<\/li>\n<li>The CHECKPOINT process is not started<\/li>\n<\/ul>\n<p>I&#8217;m going to walk you through the process of putting your SQL Server database into single-user mode. This can be either done via SQL Server Configuration Manager by setting the startup parameters or through the Command Prompt. <\/p>\n<p><strong>Method 1: Start SQL Server in single-user mode through SQL Server Configuration Manager<\/strong><\/p>\n<p>Run SQL Server Configuration Manager. Choose <strong>SQL Server Services<\/strong> from the left panel and then right-click on desired SQL Server service that needs to run in single-user mode. Select <strong>Properties<\/strong> from the drop-down menu.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/10\/configuration-manager.png\" alt=\"configuration-manager\" width=\"600\" height=\"256\" class=\"alignnone size-full wp-image-4105\" \/><\/p>\n<p>In SQL Server 2014 or 2012, click <strong>Startup Parameters<\/strong> tab. Type <strong>-m<\/strong> in the <strong>Specify a startup parameter<\/strong> box and then click <strong>Add<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/10\/sql-startup-parameters.png\" alt=\"sql-startup-parameters\" width=\"428\" height=\"500\" class=\"alignnone size-full wp-image-4106\" \/><\/p>\n<p>If you&#8217;ve installed SQL Server 2008, 2005 or an earlier version, click <strong>Advanced<\/strong> tab. Append the <strong>;-m<\/strong> to the end of the <strong>Startup Parameters<\/strong> box.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/10\/startup-parameters.png\" alt=\"startup-parameters\" width=\"395\" height=\"435\" class=\"alignnone size-full wp-image-4107\" \/><\/p>\n<p>Click <strong>Apply<\/strong> to save your changes. Restart your SQL Server instance and it should then run in single-user mode.<\/p>\n<p><strong>Method 2: Start SQL Server in single-user mode through Command Prompt<\/strong><\/p>\n<p>First of all, you need to figure out the name of your SQL Server instance. Press Windows key + R to bring up the Run box. Type <strong>services.msc<\/strong> and press Enter to open the Services window.<\/p>\n<p>Find your desired SQL Server service in the list, double click it. This will open the Properties dialog box for that service. Copy the service name listed there. In my example, the service name is MSSQL$SQLEXPRESS.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/10\/sqlserver-service.png\" alt=\"sqlserver-service\" width=\"410\" height=\"461\" class=\"alignnone size-full wp-image-4108\" \/><\/p>\n<p>Open up a Command Prompt with administrative privileges and run the following command to stop the SQL Server service.<br \/>\n<code>net stop service_name<\/code><\/p>\n<p>The next step is to start the service in single-user mode. This is done by specifying <strong>\/m<\/strong> parameter with <code>net start<\/code> command.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/10\/single-user-mode.png\" alt=\"single-user-mode\" width=\"556\" height=\"227\" class=\"alignnone size-full wp-image-4109\" \/><\/p>\n<p><strong>How to know if a running SQL Server instance is in single-user mode<\/strong><\/p>\n<p>When your SQL Server instance is started in single-user mode, it prevents multiple clients from connecting to the server at the same time. For example, if you&#8217;ve already connected to your DB with the SA account, and then try to login again through SQL Server Management Studio (SSMS), you&#8217;ll get the following error message:<\/p>\n<blockquote><p>Login failed for user&#8221;. Reason: Server is in single user mode. Only one administrator can connect at this time. (Microsoft SQL Server, Error: 18461)<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/10\/sqlserver-connect-error.png\" alt=\"sqlserver-connect-error\" width=\"600\" height=\"159\" class=\"alignnone size-full wp-image-4110\" \/><\/p>\n<p>To fix this issue, you need to remove -m from the startup parameters and restart your SQL Server instance, which will bring the database back to multi-user mode.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>What is single-user mode? There are certain situations when user may have to start a SQL Server instance in single-user mode. For example, you might need to restore your master database from a backup in the event of a failure or damage, detach the database and kill all the connections. Both actions require starting an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,10],"tags":[1935,1934],"class_list":["post-4097","post","type-post","status-publish","format-standard","hentry","category-sql-server","category-tips-tricks","tag-sql-server-single-user-mode","tag-start-sql-server-in-single-user-mode"],"_links":{"self":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/4097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/comments?post=4097"}],"version-history":[{"count":11,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/4097\/revisions"}],"predecessor-version":[{"id":4114,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/4097\/revisions\/4114"}],"wp:attachment":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/media?parent=4097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/categories?post=4097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/tags?post=4097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}