Hey, thanks for reading this already!

My problem is as follows,
I need tot load a textfile into the database using the following query:

load data infile '~/catg.txt' into table categories fields terminated by '\t';

After a while the mysql server responds with:
ERROR 13: Can't get stat of '/catg.txt' (Errcode: 2)

I also tried to do the LOAD DATA LOCAL INFILE query but it doesn't work either:

ERROR 2013: Lost connection to MySQL server during query

What am i supposed to check/do/not forget?
Server:
UNIX 6.0.0
MySQL 3.22.14b-gamma-virtual

if you need to know more, just mail me.
I hope you can help me with this!

Thanks in advance,

drm

    • [deleted]

    MySQL prefers full paths to files, so don't write "~/bla". instead, write the full path.

      I'll try that, thanks.

        2 months later

        I am trying to do the same thing with the same results.... Error 13 Can't get stat of '/home/.....myfile' code 2. I am trying to do this as root now, because I tried doing it as my db user/pass, and It said access denied ....make sure you have permission...

        How did you guys make out?

        Thanks,

          a year later

          Hi,

          I'm just having the same problem.
          I tried this Query:


          mysql> LOAD DATA INFILE "/home/rmd/password.csv" INTO TABLE mitglieder FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (benutzername, password);

          ERROR 13: Can't get stat of '/home/rmd/password.csv' (Errcode: 13)

          After this I tried this:


          mysql> LOAD DATA LOCAL INFILE "password.csv" INTO TABLE mitglieder FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (benutzername, password);

          Query OK, 0 rows affected (0.00 sec)

          But how mySQL reports nothing happend in the database.
          How can I get the information into the database to the correct 'mitglieder'.

          Thanks for help

            Write a Reply...