How to access a website database?
The short answer: you don't generally access the database in Drupal.  Drupal serves as an intermediary between you and the database, and if you access the database directly more than likely you are going to cause yourself many problems in the long run, especially in the beginning when you're not very familiar with Drupal.

For more, see Understanding Drupal and the Structure Guide on Drupal.org.