when i try to import huge table(using ssh) the server stop responding

Discussion in 'PHP' started by arambo, Mar 30, 2009.

  1. #1
    when i try to import huge table(using ssh) the server stop responding

    this is the command i use

    mysql -uusername -ppassword databasename < tablename.sql

    but if the file is big the server stops responding so i wait for hlaf an hour restart the server but when i turn it on and see what has been imported i see that 1/3 of the table was imported
    so how can i fix this ?
    i have 4gb ram and quad core xeon 3210 - centos 5
     
    arambo, Mar 30, 2009 IP
  2. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #2
    how big is your file?
     
    javaongsan, Mar 30, 2009 IP
  3. joep1978

    joep1978 Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hmm i've imported 30 million row tables before with no problems - i don't know why the server should stop responding half way through. I'd probably try splitting the file into more manageable pieces and do them chunk by chunk.
     
    joep1978, Mar 30, 2009 IP
  4. arambo

    arambo Peon

    Messages:
    218
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i think its becuse i am not giving it ram for the sql
    where i can change the amount of ram that mysql can have ?
     
    arambo, Mar 31, 2009 IP
  5. joep1978

    joep1978 Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Edit /etc/my.cnf and restart/reload
     
    joep1978, Mar 31, 2009 IP
  6. arambo

    arambo Peon

    Messages:
    218
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    what you mean edit it ?
    what i have to change?
     
    arambo, Mar 31, 2009 IP