SHARE
TWEET

Untitled

a guest Jun 5th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. ini_set('display_errors', 1);
  4. ini_set('display_startup_errors', 1);
  5. error_reporting(E_ALL);
  6.  
  7. $database = 'db';
  8. $user = 'user';
  9. $pass = 'pass';
  10. $host = 'localhost';
  11. $dir = dirname(__FILE__) . '/dump.sql';
  12.  
  13. echo "<h3>Backing up database to `<code>{$dir}</code>`</h3>";
  14.  
  15. exec("mysqldump --user={$user} --password={$pass} --host={$host} {$database} --result-file={$dir} 2>&1", $output);
  16.  
  17. var_dump($output);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top