A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Best way to back up a mySQLdatabase?

  1. #1
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991

    Best way to back up a mySQLdatabase?

    Hi guys

    How do you guys go about backing up you mysql databases? How do you guys do it in PHP?

    Also, my habit is to just simply copy the folder where my database resides (MYSQL>DATA) .. is this ok? reliable and safe??

    PLease share some thoughts... thanks

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Seoul, South Korea
    Posts
    1,310
    Hi there,
    I personally use mysqldump to backup my mysql databases. I have a cron job set to execute every day at 2:00 AM. You could even execute a script that emails the dump file to yourself.

    Cheers,
    micmac
    !.....................................COMING SOON

  3. #3
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    hmm.. sounds a good idea. is there a way to do that in php?

  4. #4
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    well?

  5. #5
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    I believe phpmyadmin can also dump a database - so why not copy the scripts from phpmyadmin?

    Musicman

  6. #6
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    isnt there a function for this?

  7. #7
    i'd say go look @ phpmyadmin and see how he's doin it ..
    (¯`·._ (¯`·._--={NoStalGicA}=--_.·`¯) _.·`¯)

  8. #8
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    yeah.. i might as well.. tnx fellas :P

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Location
    Austria
    Posts
    142

    @ Tea_J

    Would appreciate if you could post some ideas if you were successfully in finding a cool function for a simple mysql backup.
    Thx, Garfield

  10. #10
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    Hi garfieldx

    umm... well, i tried to study how PHPmyADMIN did it, but i never was good at reading someone else's codes.. so, it just made me very confused, and gave me a head ache... so what i did was, i'm just using a simple php function cleverly named "copy()"

    I simply have my app copy the databases and tables in the mysql/data/* folder into another location.. it seems to work pretty well.. i've had talks with people from MIRC and they said it was ok as long as noone wuz writting to one of the tables.. or else the data would be messed up.. so locking the tables and then copying the files is my trick..


    Anyone got something to comment agaisnt this/?

  11. #11
    Senior Member
    Join Date
    Jul 2001
    Location
    Austria
    Posts
    142
    Good idea. Thanx for posting your idea.
    Garfield

  12. #12
    This file contains a backup.php file i found in a Webshop..
    i think it can be usefull .. it has more features.. backups it in a file that can be compressed.. and also has a restore function..
    Attached Files Attached Files
    (¯`·._ (¯`·._--={NoStalGicA}=--_.·`¯) _.·`¯)

  13. #13
    Special Member Tea_J's Avatar
    Join Date
    Dec 2000
    Posts
    991
    Thanks garfieldx...


    and Nostalgica, thanks for the script.,. will review it soon..

    tae

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center