Converting large (470Mb) .csv file to MySQL on server

Discussion in 'MySQL' started by Freddy81, Dec 9, 2008.

  1. #1
    Hi,

    I want to create a script that will convert a large text file from .csv to MySQL database. It has 4,000,000 strings. Is it possible to do this by running the script on shared hosting? What should I ask my provider for (resources, cpu time, ...) ?

    Thanks,
    Fred
     
    Freddy81, Dec 9, 2008 IP
  2. webdesigners

    webdesigners Banned

    Messages:
    534
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Yes you can convert it into mysql but if you have less space in your hosting panel, than you have to increase the space otherwise it may get hanged during conversion.
     
    webdesigners, Dec 9, 2008 IP
  3. SandisV

    SandisV Active Member

    Messages:
    284
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Good idea would be to split it up into smaller chunks, you could do this on your local machine and then get the smaller files up there. Of course - if you need regular updates for full DB this could turn out a big headache.

    Anyways, best way - read a line at a time and don't store it in memory, read, insert/update, move to next line.
     
    SandisV, Dec 9, 2008 IP