We don't recommend connecting to the database directly because it's not a stable interface. We reserve the right to change the structure, names, and types in the database without telling you. If you want to interact with data in the database, use the Central API, which is a stable and documented interface. If there is something missing from the API, then let us know so we can add it.
Independent of that, making any database accessible to the Internet is not a great idea because it leaves you vulnerable to brute force attacks.
As to editing the login page, what high-level problem do you want to solve by editing this page?