Skip to content

Instantly share code, notes, and snippets.

@armanhakimsagar
Last active July 31, 2018 14:32
Show Gist options
  • Select an option

  • Save armanhakimsagar/cfbdbefcc3f148b5467d805e0f1b982a to your computer and use it in GitHub Desktop.

Select an option

Save armanhakimsagar/cfbdbefcc3f148b5467d805e0f1b982a to your computer and use it in GitHub Desktop.
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$database = 'unikeedubd_db';
$user = 'unikeedubd_user';
$pass = 'E1OR}CkSx+Rk';
$host = 'localhost';
$dir = dirname(__FILE__) . '/dump.sql';
echo "<h3>Backing up database to `<code>{$dir}</code>`</h3>";
exec("mysqldump --user={$user} --password={$pass} --host={$host} {$database} --result-file={$dir} 2>&1", $dir);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment