-
-
Save devuri/2d17b818fae01c079ab0a12af8106a83 to your computer and use it in GitHub Desktop.
Php Mysql Database backup and restore
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 | |
$dump_path = ""; //input location for the backup to be saved | |
$host = ""; //db host e.g.- localhost | |
$user = ""; //user e.g.-root | |
$pass = ""; //password | |
$command=$dump_path.'mysqldump -h '.$host.' -u '.$user.' bank > bank.sql'; | |
system($command); | |
?> |
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 | |
$dump_path = ""; //your backup location | |
$host = ""; //host | |
$user = ""; //username | |
$pass = ""; /passwprd | |
$command=$dump_path.'mysql -h '.$host.' -u '.$user.' bank < bank.sql'; | |
system($command); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment