Quantcast
Channel: SQL Archives - SQL Authority with Pinal Dave
Viewing all articles
Browse latest Browse all 594

SQL SERVER – REBUILDDATABASE Error: 0x851A0012 – Missing sa Account Password. The sa Account Password is Required for SQL Authentication Mode

$
0
0

I was in a situation where I was helping the customer to overcome a disaster. They had a hardware failure and the master database was corrupted. The plan was to first rebuild system databases and then restore ALL databases from the backup. Today we will discuss an error about REBUILDDATABASE.

SQL SERVER - REBUILDDATABASE Error: 0x851A0012 - Missing sa Account Password. The sa Account Password is Required for SQL Authentication Mode missingaccount

REBUILDDATABASE

We used below command to rebuild system databases:

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=”domain\username”

Above command was taken from Microsoft documentation where we had some optional parameters. The setup failed with below error in the setup logs after running command related to REBUILDDATABASE.

Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A0012
Error description: Missing sa account password. The sa account password is required for SQL Authentication Mode.

WORKAROUND/SOLUTION

The documentation shows SAPWD as optional so I was missing it. It looks like if SQL was installed with MIXED mode authentication then the parameter is mandatory.

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=APG1P /SQLSYSADMINACCOUNTS=” domain\username” /SAPWD= AVery@Strong@Password123

After running above command, the setup completed successfully. Post that we restored all the databases including master and they were back in the business.

Here are a few additional blog posts related to this blog post. Please do read them for additional information.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – REBUILDDATABASE Error: 0x851A0012 – Missing sa Account Password. The sa Account Password is Required for SQL Authentication Mode


Viewing all articles
Browse latest Browse all 594

Trending Articles