Issue #2176621 by sun, alexpott: Remove global $databases.