You have to dump your database to .sql
file first. Only then you can download it.
Assuming MySQL, see How to dump mysql database?
If you have phpMyAdmin (or a similar tool) available, you can dump and download the .sql
file at once from the web interface directly.