The simplest way to back up a database is to copy the files to another location. The table files have the name suffixes of *.frm, *.MYD, and *.MYI.
With MySQL 5.0 (in Ubuntu), the database files are located at /var/lib/mysql, with each database getting its own directory. Copying could be done thusly:
cp -R /var/lib/mysql/[name of database] /[where you want to put the backup copy]
NOTE: The uppercase -R after the copy (cp) command means the function copies recursively, meaning that it copies all the files and subdirectories and their files under that directory.
Taken from here.
–Joab Jackson