Jump to content

Archived

This topic is now archived and is closed to further replies.

Orio

*SOLVED* Database Backups

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Yeah, I know how to do that, but I want it to do automatic backups, like every week.

Orio.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Anyone? [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

Orio.

Share this post


Link to post
Share on other sites
[a href=\"http://sourceforge.net/projects/automysqlbackup/\" target=\"_blank\"]http://sourceforge.net/projects/automysqlbackup/[/a]

Share this post


Link to post
Share on other sites
Thanks Andy, it looks good, but I have no idea what it is.
The file is called:
automysqlbackup.sh.2.5
And when I open it with notepad it doesnt look like php =/

Orio.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
I was just about to post I found this script! It's a really good one!
Thanks alot everyone!

Orio.

Share this post


Link to post
Share on other sites

×

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.