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.
Considering the bad state of the farm, backuping the content databases and recreating the farm from scratch may be a good idea.