This is just me, doing things manually all the time, but using the --routines backs up the views and functions as well.
Example: (assuming "peq" is name of database, and "*****" is db password") :
mysqldump --routines -u root -p***** peq > peq_backup.sql
|