SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: SQL dumps

  1. #1
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL dumps

    When saving SQL dumps through phpmyadmin or ssh, am I ok to use the default setting - which has 'create database/table' instructions and so should presumably be imported into a new database rather than an existing one (which'd produce 'already exists' errors).

    Or is it better to faff-around with options like ''Add DROP DATABASE' and 'Add DROP TABLE', which presumably save a file designed for reimport into an existing database.

    Knowing little about this, I'm thinking it's almost as easy (and perhaps more reliable) to create a new database into which to import the dumps - it's certainly easier and quicker when saving the dumps.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    what is the purpose of taking the dumps?

    if the purpose is to create a new database, then that's what you would do

    if the purpose is to create a backup from which you can restore the original database if the original database gets b0rked, then there's no need to run the dump into a new database just yet
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    >what is the purpose of taking the dumps?

    To have current restorable backups of stuff like Movable Type content, the membership database etc.

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    then i would include the CREATE TABLE statements in the dumps

    a dump is restorable if you can run it into an empty database, but you would have to create the empty database first

    there would be no need for DROPs unless you were selectively restoring only a part of the backup into the existing database
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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