SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    Norway
    Posts
    355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Partially restore a database

    I need to partially restore a database and lucky me, I got a recent backup at my computer, but..

    when I try to load the file, its to large for notepad (580mb) so I use wordpad, when its finaly loaded and uses between 100-800mb of memory I cant do nothing, not even scroll or mark any text. I just need to move my mouse just a few mm before the memory use raises to around 800mb. So how am I supposed to use this backup then? Perhaps I should go buy a BlueGene/L ?

    Thanks

  2. #2
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what database are u using ?

  3. #3
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    Norway
    Posts
    355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its a mysql and the file is just a normal textfile *.sql

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    use the mysql command line client to import the file. there are lots of threads in this forum with examples on how to restore backup files using the command line client. there are also examples in the mysql manual.

  5. #5
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    Norway
    Posts
    355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried using the mysql administrator, but I'm not sure which character set to use.

    So what is the syntax for restoring a *.sql file with the mysql command line client ?

    Thanks

  6. #6
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mysql -u username -p --database=whatever < /path/to/backup.sql

    I'm reading that you only want to import some of that sql. I'd import it all into a transitional database, use whatever tools to edit it (phpMyAdmin, whatever), then export the version that contains the data you want. I'd be interested to hear if there is a better solution.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


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
  •