Last active
October 24, 2019 08:43
-
-
Save cybromujeeb/ddc7fbf43498a13c4de54f556c2aaf8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//created by mujeeb rahman https://cybrohosting.com | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
//export sql mysql shell | |
$database = 'ffmpeg'; | |
$user = 'root'; | |
$pass = 'mujeeb123'; | |
$host = 'localhost'; | |
$dir = $_SERVER['DOCUMENT_ROOT'].'/uploads/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", $output); | |
var_dump($output); | |
//import sql mysql shell | |
$dir = $_SERVER['DOCUMENT_ROOT'].'/uploads/dump.sql'; | |
$cmd="(mysql --user=root --password=enfin123 --host=localhost --database testdb < $dir) 2>&1"; | |
exec($cmd, $output, $return_var); | |
var_dump($return_var); | |
echo "return_var is: $return_var" . "\n"; | |
var_dump($output); | |
//Thanks | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment