Jump to content

Recommended Posts

Hello [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

How do you program a script that backs up the database, saves it to a (txt or sql) file and send it via email?
I have no idea how to that... I know I can have a cron task to do that lets say every week, but I have no idea how write the backup script...
And no, I am not asking for a full script (tho that could be good [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] ), just a link to a tutorial, or a general explanation.

Oh, and if this can be down via PHPmyAdmin that will be much better.
So if it's possible with PHPmyAdmin, a explanation how to do it or a link to a tutorial will be great.

Btw, I have Cpanel if this is helpful.


Thanks alot,
Orio.
Link to comment
https://forums.phpfreaks.com/topic/12716-solved-database-backups/
Share on other sites

If you have phpMyAdmin you can do a full database thgrough that. To do so login to phpMyAdmin and click the Export link on the main page of phpMyAdmin.

This now brings up the database backup page. Select the database(s) from the list on the left. To select multiple databases in the list Crtl + Click on the databases you want to backup.

Now read through all various options on the right hand side, the defualt settings should do just fine. Now scroll to the bottom of the page and tick the save as file option, then chose a name and the compression of the file.

Once finished click Go. phpMyAdmin will now backup the databases you selected and will prompt you to download the backup file. Thats how you do a database backup through phpMyAdmin
If you want to do it automatically then it'll require you to setup a cron job which will execute your database backup script. Theres are tutorials [a href=\"http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php\" target=\"_blank\"]here[/a] and [a href=\"http://www.developertutorials.com/tutorials/php/backup-mysql-database-php-050409/page1.html\" target=\"_blank\"]here[/a] on backing up a mysql database with PHP

/* Off topic */
Your avator is really distracting! I cant stop looking at it.
Thanks for trying wildteen88, but these scripts backup tables. I want a script that finds all the tables in my DB, and then create a file that what's written in it is:

create tableX(all fields);
insert into tableX(...) //Dump all of the rows
create tableY(all fields);
insert into tableY(...) //Dump all of the rows

With all of the tables in the DB.


Just like PHPmyAdmin does just without it.

Orio.
By looking at the [a href=\"http://members.lycos.co.uk/wipe_out/automysqlbackup/\" target=\"_blank\"]homepage[/a] of that script it is "cron job" code, if there is such as thing. And it looks like you may need root access to use it. Have a look at the installation part (bottom of page).

Umm, it looks like we are failing you! :(

Would you believe it! We have a premade one here! [a href=\"http://www.phpfreaks.com/script/view/11.php\" target=\"_blank\"]CLICKY[/a]. It looks like there is very few scripts on this! Or I'm putting in the wrong keywords to search for such a script!
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.