MySQLDump backup class interface
Categories: MySQL, Source Code, Web, php
Tags:
MySQLDump class is now at version 2.0 and this article contains obsolete informations about the version 1.0. For information about the new version check this article
After the success of the article PHP backup of a mysql database, I decided to write a short post about a file that can be usefull to download the backup of your db site/wordpress blog directly from your browser.
To use the script, you can simply download it and edit the first lines with the basic configuration:
// DB Configuration $server = "IP of your server (localhost will work in most cases)"; $username = "Valid username for your mysql db"; $password = "Password"; $dbToDump = "Db to dump"; // password to access the php page. PLEASE change the default password!!! $backupPassword = "UltraSecretKeyThatYouMUSTInsertHere"; // filename to save $filename = "backup.sql.gz";
After that you can upload the file to your server, in the same folder where is located the class MySQLDump.
To access the script you have to specify two parameters: the password to access the script (pass), and another parameter (t) that if it’s 1 will separate the SQL inserts every 100 rows.
For example, if you upload the file to the root directory of yoursite, you have to write in the address bar of the browser:
http://www.yoursite.com/backup.php?pass=UltraSecretKeyThatYouMUSTInsertHere&t=1
…and your favorite browser will open the dialog to save the file with the db backup!
Download MySqlDump Interface.php. Downloads: 657
For more info about the MySQLDump class, read the original post, or download the source from here:
Download MySQLDump. Downloads: 4321
Se sei interessato a questo post, potresti anche provare a leggere:
- No related posts
26 Sep 2007 dzamir
[...] Blog Coders4Fun ist auch sehr empfehlenswert, da habe ich ein PHP Script gefunden, um MySQL Backups auf Abruf zu erstellen, aber diesem Script werde ich noch einen eigenen Beitrag [...]