How ot take backup the whole database with PHP?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikek12004
    New Member
    • Sep 2008
    • 200

    How ot take backup the whole database with PHP?

    I have a button "MysQl Backup" and I want when clicked to create a DB backup in a txt files (containing SQL commands)
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    There are several ways to create database backups.

    I would recommend trying either SELECT * INTO OUTFILE, or the mysqldump command. Both these methods create a file on the server containing the data, which you could then forward to your clients via PHP.

    The alternative is to manually fetch all the data and construct the database backup file using PHP. I wouldn't recommend that. No need to reinvent the wheel.

    Comment

    Working...