Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    19

    Unanswered: using mysqldump and preserver view

    Hello,
    I have done a few searches but have not found what I'm looking for. I have a MySQL database and I want to do a nightly dump, for now. This is really not that hard, but what I'm seeing is not what I expect. My views are not in the SQL dump in any kind of format to restore the view. Is there a switch or something that will create the view sql statement in the dump file as well?

    Thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    since views don't contain any data, it's not surprising that they aren't included in the dump

    do you dump your CREATE TABLE statements too, or just the data?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2003
    Posts
    19
    I have two dumps one is just structure only, no data. This I want to have done on a daily basis since the schema can change fairly often, new tables etc. The other is data and structure.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    for the views, you will have to write your own script

    run a query against the INFORMATION_SCHEMA to pick up the view names, then use these to generate the SHOW CREATE VIEW statements
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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