Merhaba,
Mysql yüklü olan sunucuların çoğunda mysqldump adlı program da mevcuttur, yazmış olduğum aşağıdaki script i istediğiniz yere kaydedip kullanabilirsiniz, DB bilgilerini düzenlemeniz yeterlidir.

<?php
const DB_USER = '';
const DB_PASS = '';
const DB_HOST = '';
const DB_PORT = '';
const DB_NAME = '';

const FILE_NAME = 'backup.sql';

header('Content-type: text/plain');
header('Content-Disposition: attachment; filename=' . FILE_NAME);

passthru(sprintf('mysqldump --user=%s --password=%s --host=%s --port=%d %s', DB_USER, DB_PASS, DB_HOST, DB_PORT, DB_NAME));