The question is a bit ambiguous. It's best not to poke at the database itself as a file (or set of files). If you really need to edit it directly, use phpMyAdmin or the like.
In recent versions of c5, the database name and access details are stored in application/config/database.php. It can be necessary to edit those details when transferring sites between hosts.
I think the thread owner do not want to edit the database as a file. He wants to know where he has to configure the access to it. I guess that the configuration was made automatically during installation. Afterwards if you want to use another db host or something like that, you have to do it manually. You can change those settings in application/config/database.php
In recent versions of c5, the database name and access details are stored in application/config/database.php. It can be necessary to edit those details when transferring sites between hosts.