#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    1
    Rep Power
    0

    Problem with LOAD DATA INFILE


    Hallo,

    I'm completely new to MySQL and have a problem now with LOAD DATA INFILE. There is a .csv file containing a table of the following form (5 colloms, a space character seperates the colloms):

    213 3.14 0.815 2012-05-05T21:45:22Z abcd
    123 4.23 9.234 2012-06-10T22:02:49Z sdfg
    My aim is to import this in a table in a database in MySQL.
    At first I created a database, called database1 and chooses it with USE. Next, I created a table with the following command:

    CREATE TABLE table1 (id1 long, number1 float, number2 float, date1 datetime, name1 varchar(100))

    Is this correct so far? Is the datatype 'datetime' the correct one for e.g. '2012-05-05T21:45:22Z'

    Now I wanted to fill this table with a file:

    LOAD DATA INFILE '/home/aaa/bbb/ccc/clientdata.csv' INTO TABLE table1;

    but I get the following error:

    ERROR 29 (HY000): File '/home/aaa/bbb/ccc/clientdata.csv/clientdata.csv not found (Errcode: 13)

    So where is my mistake? I hope you can help me, because I have no idea what else I can try what I havn't already tried out.

    Best regards

    tiemoe
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,921
    Rep Power
    1045
    Originally Posted by tiemoe
    I hope you can help me, because I have no idea what else I can try what I havn't already tried out.
    So what did you try out? A quick Google search brings up plenty of suggestions.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo