Using a .php file to generate a MySQL dump
<?php exec('mysqldump --user=... --password=... --host=... DB_NAME > /path/to/output/file.sql'); ?>