Skip to content

Instantly share code, notes, and snippets.

@hugsbrugs
Created January 3, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugsbrugs/c2b1597c33ee528cc6d2 to your computer and use it in GitHub Desktop.
Save hugsbrugs/c2b1597c33ee528cc6d2 to your computer and use it in GitHub Desktop.
<?php
// IN SAME REPO AS THIS FILE
// YOU SHOULD HAVE my_database_dump.sql FILE
// ADD AT TOP OF THIS FILE
// use my_database_name;
echo "Your database is being restored.......<br>";
system("cat my_database_dump.sql | mysql --host=localhost_or_other --user=my_db_username --password=my_db_password my_database_name");
echo "It's over. Your database has been restored.";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment