SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: dump and insert

  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dump and insert

    What is the command to dump the database structure, data and zip it?

    Also what is the command to execute the sql file to the db?
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For backing up:
    Code:
    mysqldump -u username -p db_name | gzip > backup.sql.gz
    For restoring:
    Code:
    mysql -u username -p db_name < backup.sql
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  3. #3
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Toly
    For backing up:
    Code:
    mysqldump -u username -p db_name | gzip > backup.sql.gz
    For restoring:
    Code:
    mysql -u username -p db_name < backup.sql
    how do you restore from the zip? also is this the best way to transfer large databases? say like a gig?
    Free Science Homework Help
    http://www.physicsforums.com

  4. #4
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dethfire
    how do you restore from the zip? also is this the best way to transfer large databases? say like a gig?
    You can use winzip to extract the file. And for the second question, as far as I know, that is the best method.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine


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
  •