Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MySQL, loading data into a table from a textfile problem

Options
  • 17-10-2007 6:59pm
    #1
    Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭


    I'm trying to populate a table using a text file. For the life of me I can not find why it is not working.
    Here is what I write:

    mysql> LOAD DATA LOCAL INFILE 'C:/Documents and Settings/Paul/Desktop/active.txt'
    INTO TABLE active;
    ERROR 2 (HY000): File 'C:\DocumentsandSettings\Paul\Desktop\active.txt' not found (Errcode: 2)

    Anybody know how to fix this rather trivial thing?
    I have no idea why it can not find a file no matter what I do.


Comments

  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Quick fix, through the file to the C drive and then amend the file path and it will work

    The answer is to the \ before spaces in Documents And Settings to make it work


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Hi, the first thing I tried was putting it in the c drive and it still did not work. File could still not be found. I don't follow your seond sentence, the spaces in Documents And Settings are the problem?


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    'C:/Documents\ and\ Settings/Paul/Desktop/active.txt'

    Should do it I think, its been a very long time since i used mySQL


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Thanks mate, I fixed it. It was odd, I changed the name of the file and it worked...
    Anywy, cheers for the help.


Advertisement