SharePoint Error: Failed to connect to the configuration database

Error:

Failed to connect to the configuration database.

An exception of type System.InvalidOperationException was thrown.  Additional exception information: Windows SharePoint Services configuration infrastructure is not initialized.  You must wait until completion before joining another server to the farm.

System.InvalidOperationException: Windows SharePoint Services configuration infrastructure is not initialized.  You must wait until completion before joining another server to the farm

 

Solution:

I was excited about SharePoint and wanted to install Windows SharePoint Services 3.0 in one of my virtual environments. I downloaded the WSS 3.0 with SP2 from WSS 3.0 with SP2

After installing it, I attempted to run the SharePoint Products and Technologies Configuration Wizard but it came up with the above error message. It was a bit frustrating. It tried many things to find out what was causing this.

I had WSS 2.0 already installed on my server so thought that might be causing the above error, so tried uninstalling WSS 2.0 and re-ran the SharePoint Products and Technologies Configuration Wizard and still go the same error.

Finally what worked for me was I created the SharePoint database using the PSCONFIG.EXE tool which comes with your SharePoint Services 3.0 Installation.

Using my Command Prompt I went to the following  path

C:\\Program Files\\Common Files\\Microsoft Shared\\web server extensions\\12\\BIN\\

 

And ran the PSCONFIG.EXE tool to create the database with a unique name of my choice.

PSCONFIG.EXE" -cmd configdb -create -database <yourDatabaseName>

This created the database and the SharePoint Products and Technologies Configuration Wizard ran fine this time.

It looks like the Wizard tries to create the SharePoint Database to its default instance and for some reason if it does not find it, it fails. So creating a SharePoint database using the above tool seems to resolve the issue.