Results 1 to 5 of 5

Thread: What is INFORMATION_SCHEMA?

  1. #1
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,730
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default What is INFORMATION_SCHEMA?

    Just wondering what INFORMATION_SCHEMA is and whether it is important to back it up. As I recall it has certain write/delete restrictions placed on it. I could check, but I wasn't sure how dangerous it would be to play around with it.
    To choose the lesser of two evils is still to choose evil. My personal site

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    MySQL stores its own configuration internally (at least part of it). That's the INFORMATION_SCHEMA.

    If you're moving servers, then just backup the database like you usually would. Then you can use the automatically generated "CREATE TABLE" queries to recreate the structure. In fact, you might not even have access to modify the INFORMATION_SCHEMA table.

    But if you are staying on the same server, don't change it or it might erase (or modify) your tables.

    Basically the INFORMATION_SCHEMA is the table that stores the information about your tables. Interesting circular logic (although I don't think it stores information about itself actually).

    http://dev.mysql.com/doc/refman/5.0/...on-schema.html
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,730
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    When you say "backing up your database like you usually would" are you saying it is fine to back up the database without the INFORMATION_SCHEMA? That's how I normally do it.
    To choose the lesser of two evils is still to choose evil. My personal site

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yeah, exactly. INFORMATION_SCHEMA stores the current configuration. When you back up your database it includes "CREATE TABLE" and other queries designed to re-create the old setup in the new database. Also, it won't conflict* with any of the existing content (so you could merge databases). If you did include INFORMATION_SCHEMA, then you would have to either replace the existing one or find a creative way to merge them.

    (*Except if there are any shared names [eg, for tables] in the new and old databases you're merging.)

    In short, INFORMATION_SCHEMA is part of your server (MySQL) configuration, not your data. Your new server will also need to be configured, but you don't need to do it (and probably shouldn't) by copying that table, just like you won't be copying a disc image of the operating system of your first server to your new server. (Of course you could do that if you want to identically copy the database, but it's not required.)
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,730
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    That makes sense. Thanks, I was rather curious about this.
    To choose the lesser of two evils is still to choose evil. My personal site

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
  •