mysql> LOAD DATA INFILE '/home/myuser/myproject/power/ids-ads.txt' INTO TABLE ids_ads FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
ERROR 29 (HY000): File '/home/myuser/myproject/power/ids-ads.txt' not found (Errcode: 13)
The file is there. I even pasted the path into the mysql console. The permissions are correct.
In fact, I even tested it on root user and root mysql.
-rw-r--r-- 1 myuser myuser 15893 2010-12-26 20:56 ids-ads.txt
Lost connection to MySQL server If an error message like “Lost connection to MySQL server” appears while querying the database, it is certain that the error has occurred because of network connection issues.
1062 - Duplicate Entry To solve this, Set the primary key column as AUTO_INCREMENT . And when you are trying to insert a new row, ignore the primary key column or insert NULL value to primary key.
Note that when you do LOAD DATA INFILE, MySQL is looking for that file on the server - not on your client machine.
If you want to use LOAD DATA INFILE to load a file that is on the client machine (and not the server machine), you must use LOAD DATA LOCAL INFILE.
http://dev.mysql.com/doc/refman/5.1/en/load-data.html
From the MySQL manual:
For security reasons, when reading text files located on the server, the files
must either reside in the database directory or be readable by all. Also, to use
LOAD DATA INFILE on server files, you must have the FILE privilege. For non-LOCAL
load operations, if the secure_file_priv system variable is set to a nonempty
directory name, the file to be loaded must be located in that directory.
http://dev.mysql.com/doc/refman/5.1/en/load-data.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With