I discovered the hard way that renaming the .xml files in the app/etc directory by prefixing them (but leaving the .xml extension) was causing problems with my Magento site.
It turns out that Magento loads all *.xml files from the app/etc directory, not just global.xml and local.xml. See function loadBase() in app/code/core/Model/Config.php
The .xml files are then processed in the order returned by glob (which I believe is alphabetical by default). This means that local.xml values overriding global.xml values is just a side-effect of the fact that global.xml is returned eariler in the list.
The problem is, if you have extra files, like I did, the files that come later in the alphabet may override your settings in local.xml ! I've learned my lesson and no longer leave the trailing .xml on my backup files in that app/etc directory anymore.
Hope this is useful to others debugging mysterious database connection issues!