Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am an absolute beginner to MySQL (5.5.34) / Linux (Ubuntu 12.04 LTS)`

I have created a simple database with one table. When trying to import data into it via a 'data_test.csv file an error message 13 appears.

Exert from Terminal follows:

mysql> source /home/g/stockrecdb/load_test.sql;
Database changed
ERROR 13 (HY000): Can't get stat of '/home/stockrecdb/data_test.csv' (Errcode: 2)
mysql> 

Note: if using LOCAL in LOAD DATA LOCAL INFILE an error appears: ERROR 1148 (42000): The used command is not allowed with this MySQL version

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I hope you are using LOAD DATA INFILE.

Try to use LOAD DATA LOCAL INFILE instead of LOAD DATA INFILE.

Other issue might be this, please visit the following links : MySQL LOAD DATA.

When you login in MySQL do like below,

abdul@xmpp3:~/Desktop/Jiva$ mysql -uroot -p --local-infile
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 257
Server version: 5.5.29-0ubuntu0.12.04.1-log (Ubuntu)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mydb;


mysql> LOAD DATA LOCAL INFILE '/home/abdul/Desktop/STATISTIC_T.csv' INTO TABLE STATISTIC_T  FIELDS TERMINATED BY '|' ENCLOSED BY '"' LINES TERMINATED BY '\n'  IGNORE 1 LINES;

Now load your CSV using LOAD DATA LOCAL INFILE ,we need to use --local-infile before we load CSV in in new MySQL vesrsions, due to security reasons.

share|improve this answer
    
Hello Adbul Manaf, Apparently, I cannot use LOCAL due to mysql version (I have edited my question regarding this) –  Guillermo Jan 2 at 5:52
    
Updated my answer. –  Abdul Manaf Jan 2 at 5:58
    
EXCELLENT! Thank you very much Abdul! It worked!! –  Guillermo Jan 2 at 7:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.