There are many ways to do this (assuming you have the legal right to access the database).
You can write a program that runs on the site, giving you secure access (login, etc.) to the database.
You can connect to a shell account on the site and access the database using a program that runs on the site.
You can run a program on your laptop that accesses the database remotely.
The best way for you depends on some things, such as what you should do, the access you have to the site, your capabilities, etc.