Backing Up a MySQL Database (do NOT use phpMyAdmin)

I have always regularly backed up this website, including its database. However, I have discovered that the database backups have been either corrupt or incomplete. This came to my attention when I looked back at the database backups and noticed that they were all less than a few MiB in size (compressed) and the size remained constant. The database itself, however, is approximately 27 MiB. Even taking the compression into account, these files were too small; a test uncompressed  backup (i.e., raw *.sql file) came to 5 MiB. Clearly, something was wrong.