Login as admin and disable and uninstall rewrite module.
From the main login screen, select 'Databases'
Now click the name of your database - or your Gallery database if you have several databases.
The next screen will show you all the tables inside your Gallery database.
Ignore those, and click the 'Export' tab on the top set of tabs.
Look at the left box at the top of the Export section. All the tables in the database you selected are in that box.
If you have other programs that use the database, then choose only those tables that correspond to your Gallery install. They will be the ones that start with "g2_" or whatever 'tablePrefix' you specified in your 'config.php' file.
You need to copy where all the radio buttons and checkboxes are checked.
Tick the 'Save as file' option, and leave the template name alone.
For now, select 'None' for compression.
Now click 'Go' and you should be prompted for a file to download. Save the file to your computer.
Depending on the database size, this may take a few moments.
Once that download is complete, check the 'zipped' option, click 'Go', and download the next file.
If you wanted, you could download a backup in each of the compression formats. Your choice.
You have now backed up your database.
Remember - you have NOT backed up the files and folders - such as images - but all your users, comments and albums are now safe.