Backup MySQL Database

From James's Wiki

back it up with:

mysqldump -u <username> -p<password> <database name> > /media/temp/<database name>

NOTE: there is no space between -p and the password

restore:

mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]

Source: http://webcheatsheet.com/sql/mysql_backup_restore.php