mysql backup in terms of 100 rows at a time

Discussion in 'MySQL' started by chandan123, Jul 16, 2008.

  1. #1
    how to take mysql backup in terms of 100 rows at a time

    suppose if i have say 5000 records how can i take backup to a sql file

    which consists of 100 rows insertions ?
     
    chandan123, Jul 16, 2008 IP
    deshabhishek007 likes this.
  2. spyrit

    spyrit Well-Known Member

    Messages:
    1,788
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    150
    #2
    first...why would you want to do that?
    second: if you really do want to do that...you should do something like

    $i = 0;
    $ii = 100;

    While ($ii < 1000) {

    $query = "select url FROM database LIMIT $i, $ii";

    $i = $i+100;
    $ii = $ii+100;

    }

    programatically works faster, but you can do it by hand in the phpmyadmin..it will take a while though.
     
    spyrit, Jul 22, 2008 IP
    chandan123 likes this.
  3. chandan123

    chandan123 Prominent Member

    Messages:
    11,586
    Likes Received:
    578
    Best Answers:
    0
    Trophy Points:
    360
    #3
    i want this because if i place (insert into table x (a,b) values (1,2),(2,3) ........................)

    it takes tooo much time to load while reuploading

    so i need
    insert into table x (a,b) values (1,2),(2,3)
    insert into table x (a,b) values (4,5),(6,7) ;)
     
    chandan123, Jul 22, 2008 IP