PHP MySQL database export

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gnawz
    New Member
    • Nov 2006
    • 64

    PHP MySQL database export

    Hi,

    I need a script that I can put in my admin panel to back up/restore, export/import a MySQL database.
    Something to use online, instead of PHPMyAdmin

    Somebody please help.
  • nathj
    Recognized Expert Contributor
    • May 2007
    • 937

    #2
    Try a Google search

    Alternatively you can use a desktop application such as Navicat (commercial product) or what about MySQL WorkBench

    That's my suggestion, personally I use Navicat or PHPMyAdmin if the host provides it.

    nathj

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      You could try doing mysqldump using one of the program execution functions and then output the dump file. You could even try zipping it first if you want that.

      Then, if the user wants to restore the database, you simply have them upload the backup file and execute it using one of the program execution functions.
      Something like this should work:
      [code=php]exec("mysql -u Username -pPassword < /path/to/backup/file.sql");[/code]

      Comment

      • gnawz
        New Member
        • Nov 2006
        • 64

        #4
        I need to do something like have a button or link that a user clicks then it opens a browse window for the user to select where to save the backup copy of the database...

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Originally posted by gnawz
          I need to do something like have a button or link that a user clicks then it opens a browse window for the user to select where to save the backup copy of the database...
          Do what Atli is suggesting, but program it to a button or a link.

          You need to know at least the basics of PHP programming.




          Dan

          Comment

          Working...