Database settings moved to separate file.

main.php and console.php just include it.

fixes #3489, close #3490