I'm facing Cannot connect to configuration database error while trying to access my site. This happened after I installed Active Directory and made my sharepoint server the domain controller, which I know was a big mistake. I then demoted domain controller and uninstalled AD, but the problem is all configured accounts are gone and groups such as WSS_ADMIN_WPG, WSS_RESTRICTED_WPG and WSS_WPG too. I created these groups manually and managed to start Sharepoint Services Administration service with newly created account so Central Administration is working, but I was unable to fix access to my portal site. Any help in solving this problem would be appreciated. Thanks in advance!
Try to launch configuration wizard.
If it ask you to connect to an existing farm, connect to the existing configuration database.
If not, just going though the wizard may recreate all needed groups and permissions.
Considering the bad state of the farm, backuping the content databases and recreating the farm from scratch may be a good idea.