SharePoint Server 2016 error - Failed to connect to the configuration database


When you have completed the initial installation of SharePoint Server 2016 IT Preview and run the Product Configuration Wizard, you receive following error

Configuration Failed

One or more configuration settings failed. Completed configuration settings will not be rolled back. 
Resolve the problem and run this configuration wizard again. 
The following contains detailed information about the failure:

Failed to connect to the configuration database.

An exception of type System.NullReferenceException was thrown. 
Additional exception information: Object reference not set to an instance of an object.

To diagnose the problem, review the application even log and configuration log file located at:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\LOGS\PSCDiagnostics_xxxx.log
Resolution

The message says it all - "Failed to connect to the configuration database."

You can click on the PSCDiagnostics log file to get more insights related to this error.

Check the account which you are using to connect to SQL Server instance, make sure it has the required permissions/roles to create configuration database -

  1. Dbcreator
  2. SysAdmin
  3. SecurityAdmin
  4. Once the correct permissions are set, re-run the Product Configuration Wizard and it should complete without any issues.