Detect environment for database credentials.