How to DB Schema Dump?

Discussion in 'MySQL' started by misohoni, Sep 13, 2011.

  1. #1
    Is this done via SSH or can be done via Cpanel?

    I don't know what DB a schema dump is, is just the "skeleton" of the DB but without the content - outputted as a .sql file?
     
    misohoni, Sep 13, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    You could do it via ssh, or you can do it with phpMyAdmin by unchecking the 2 "Data" checkboxes before doing the save.
     
    Rukbat, Sep 13, 2011 IP
  3. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #3
    Thanks do you mean Export and unchecking "Data dump options":

    - Dump binary columns in hexadecimal notation (for example, "abc" becomes 0x616263)
    - Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones)
     
    misohoni, Sep 13, 2011 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    You said you just want the table definitions, not the data, so on the right side of the Export window, the third panel in the options panel, uncheck the word "Data". Then you'll save the "Create Table" statements with all the fields in each table, but no data.

    Different versions of phpMyAdmin have different screen setups - I'm looking at version 3.3.9 at the moment - but the option is about the same in all of them. You want to export the database, but you don't want to export any data.
     
    Rukbat, Sep 13, 2011 IP
  5. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #5
    Yep I think my version is different. I guess it's this:

    Dump table
    - structure
    - data
    - structure and data

    So I just click "structure" instead of the default "structure and data"?

    thanks again
     
    misohoni, Sep 13, 2011 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #6
    Yes, since that's what it sounds like you want, from your first post.
     
    Rukbat, Sep 14, 2011 IP
  7. p4guru

    p4guru Active Member

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #7
    via ssh2 telnet use either --no-data or -d option http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_no-data

    mysqldump -d -u mysqlusername -p dbname > backupschema.sql
    Code (markup):
     
    p4guru, Sep 15, 2011 IP