inserting data vis ssh?

Discussion in 'MySQL' started by Lpspider, Jul 2, 2007.

  1. #1
    I want to inset a few 1000 lines of code into an existing database... but it times out every time.

    Is there a way to ssh a file on the server to the database or something?

    What'd be the best way to do this?
     
    Lpspider, Jul 2, 2007 IP
  2. Lpspider

    Lpspider Well-Known Member

    Messages:
    2,216
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    160
    #2
    The database is MySQL and times out after 300 seconds.
     
    Lpspider, Jul 2, 2007 IP
  3. sadface

    sadface Peon

    Messages:
    6
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you have ssh access to the server, and a file containing the sql queries you want to perform? If so, it's a piece of cake:
    
    user@server1:~# mysql -u user -p dbname < sql_file.sql
    
    Code (markup):
    How are you importing the data right now? Are you sure it's mysql that's timing out, and not for instance php?
     
    sadface, Jul 3, 2007 IP
    Lpspider likes this.
  4. Lpspider

    Lpspider Well-Known Member

    Messages:
    2,216
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    160
    #4
    I got it to work, thanks. I actually had an error in the code (that didn't through an error) so that's what threw me off (haha).

    Thanks though. :p
     
    Lpspider, Jul 4, 2007 IP