Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 3:33 PM   #1
James
 
James's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MYSQL Backup & Restore using PHP ?

HI,

I'm looking for a script that will allow users/admins to have a one
click backup solution for a MYSQL Database..

'BACK DATABASE' button, click and its done...

The a restore option, that shows all current backups, and restores the
selected one with one click...

Can this be done, ?

Can you point me in the right direction ?

Thanks
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Advertisements
Old 07-01-2007, 3:33 PM   #2
James
 
James's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MYSQL Backup & Restore using PHP ?

Zac..

Thanks, I think you've cover every solution !!

Thanks

On Wed, 9 Jul 2003 13:03:15 -0600, "Zac Hester" <news@planetzac.net>
wrote:

>Hi James,
>
>This is a very simple task and should not require a tremendous amount of
>programming (I've done it with several web sites).
>
>How do you plan on backing up the database? I've used three methods
>depending on how you want to handle it:
>
>1. You can run a "mysqldump" from the command line (using passthru() or
>exec()) and redirect the output to a file:
>
> exec('mysqldump --add-drop-table -h hostname -u username -ppassword
>databasename > backup.sql');
>
>This would create a text file containing all of the database information
>necessary to recreate the entire database from scratch. Keeping multiple
>backups is just a matter of giving each filename a unique name (using the
>date, for instance). To restore your database from this backup you can run
>the mysql client like this:
>
> exec('mysql -h hostname -u username -ppassword databasename <
>backup.sql');
>
>The advantage is that this is really simple. The disadvantage is that the
>directory to which you are writing the backups has to be writable by the web
>server user (which is an inherent security risk).
>
>2. If you're not so worried about the database server crashing (why would
>you be if you're using MySQL), you can take the results of the mysqldump
>command and send it to a separate database:
>
> $backup = passthru('mysqldump --add-drop-table -h hostname -u
>username -ppassword databasename');
> $query = 'insert into backups (backuptime, data) values ('.mktime().',
>\''.addslashes($backup).'\')';
>
>Where the table containing the backups looks like this:
>
> create table backups (
> id int(4) not null auto_increment,
> backuptime int(12) not null,
> data largetext,
> primary key(id)) type=MyISAM;
>
>To restore the data, you would want to send the queries back into the mysql
>client like this:
>
> exec('mysql -e \''.str_replace("\n", " \\ \n", $backup).'\' -h
>hostname -u username -ppassword databasename');
>
>This has the advantage of being much more secure (it doesn't require any
>crazy write permessions) and is still pretty simple. However, it does rely
>on the database backing itself up. If you fear your DB server isn't very
>stable, this is not an acceptable solution. If you're backing up the DB
>just in case a user foobars it, this is a great solution. Just make sure
>the backup table is held in a different database, so you don't try to
>backup/restore all the backups.
>
>3. The last method I've used involves a lot more programming, but is nice
>if you want a lot of control over your backups. Since you probably already
>know your table structure in advance, you can just query the database from
>PHP (like normal) retrieving all of the information. Then, store the
>results of the individual queries in a backup database (like the previous
>example). Then, when you need to restore all or part of your database,
>delete the information from the affected tables and reinsert it using the
>information from your backup database. You can keep extensive catalogs of
>backups or just "snapshots" of the entire DB this way. This is also a nice
>way to backup your database onto a completely different computer (if you
>just send the backups to a different host for storage).
>
>HTH,
>Zac
>
>
>
><James @ nothere.com (James)> wrote in message
>news:3f0c0ee0.704813538@news.btclick.com...
>> HI,
>>
>> I'm looking for a script that will allow users/admins to have a one
>> click backup solution for a MYSQL Database..
>>
>> 'BACK DATABASE' button, click and its done...
>>
>> The a restore option, that shows all current backups, and restores the
>> selected one with one click...
>>
>> Can this be done, ?
>>
>> Can you point me in the right direction ?
>>
>> Thanks

>
>


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:35 PM   #3
Frank
 
Frank's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default MYSQL Backup & Restore using PHP ?

Isn't it just a matter of copyomg the file from one directory to
another ??

Or copy from server to Floppy ?



On Wed, 9 Jul 2003 12:49:08 +0000 (UTC), James @ nothere.com (James)
wrote:

>HI,
>
>I'm looking for a script that will allow users/admins to have a one
>click backup solution for a MYSQL Database..
>
>'BACK DATABASE' button, click and its done...
>
>The a restore option, that shows all current backups, and restores the
>selected one with one click...
>
>Can this be done, ?
>
>Can you point me in the right direction ?
>
>Thanks


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup & Restore 5.0.21 => 4.1.12 McHenry Database 1 06-10-2007 12:23 AM
Is it possible to restore MYSQL tables with only FRM files Rock2005 Database 0 05-31-2007 8:42 PM
Is Backup on PS3 Possibly ? / Sind Backup`s auf PS3 schon möglich ? dbox Computer Consoles 1 05-30-2007 1:49 PM
Quick-Restore compaq presario 1230 gerhard Operating Systems And Software 0 05-28-2007 5:58 PM
How to restore a position Graphman Google questions 1 05-28-2007 1:45 AM


Featured Websites




All times are GMT +1. The time now is 3:50 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98