How to implement effective MySQL database backup mechanisms?
I think what you're looking for is mysqldump. Something like the following should get it done:

mysqldump -u root -p --databases DB_NAME &gt; databasename.sql