Problem
Where does SharePoint farm locate its configuration database. You cannot find it in the web.config or in any other configuration files
Solution
SharePoint actually stores the connection to the configuration database in the registry (see dsn key).
SharePoint 2007: HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB
SharePoint 2010: HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB
SharePoint 2013: HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\ConfigDB
Tested Platform
Sharepoint 2010
Windows 2008 R2
Hits: 113