I am trying to study how to connect a program (in terminal) in C++ with a database. At first it doesn't matter what type of database it is (if MySQL, .mdb). I've searched everywhere and can't find a solution. What I see the most is how to connect it through visual studio, and I don't use it for anything, only Sublime. Where can I find any reference/guide/documentation about this?
The C++ standard does not currently provide any standard mechanism for accessing databases. It is for this reason that to cover this feature you need to resort to third-party libraries (or program your own system).
To access the databases you have at your disposal a multitude of libraries, each one with its advantages and disadvantages:
You could do it with sqlite, it's much easier since it's a file.
https://www.sqlite.org/cintro.html
Cheers,