Mysql Load Data Infile Error File Not Found
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more error 29 (hy000): file not found (errcode: 13) about Stack Overflow the company Business Learn more about hiring developers or posting ads mysql load data infile file not found windows with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow #1148 - the used command is not allowed with this mysql version is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up LOAD DATA INFILE does not work up vote 5 down vote favorite mysql error code 2 1 I am running MySQL on my Ubuntu machine. I checked /etc/mysql/my.cnf file, it shows my database temporary directory: ... basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp ... As it shows, my MySQL server temporary directory is /tmp . I have a students.dat file, the content of this file is like following: ... 30 kate name 31 John name 32 Bill name 33 Job name ... I
Error 1148 (42000): The Used Command Is Not Allowed With This Mysql Version
copied the above students.dat file to /tmp directory. Then, I run the following command to load the data from students.dat file to the students table in my database: LOAD DATA INFILE '/tmp/students.dat' INTO TABLE school_db.students FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' (student_id, name, attribute) But I got the error message in MySQL console: ERROR 29 (HY000): File '/tmp/students.dat' not found (Errcode: 13) Why mysql can not find the students.dat file though the file is under mysql temporary directory? P.S. The students table is like following (there are already 4 records in the table before run the LOAD DATA INFILE... query): mysql> describe students; +-------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------+--------------+------+-----+---------+-------+ | student_id | int(11) | YES | | NULL | | | name | varchar(255) | YES | MUL | NULL | | | attribute | varchar(12) | YES | MUL | NULL | | | teacher_id | int(11) | YES | | NULL | | +-------------------+--------------+------+-----+---------+-------+ 4 rows in set (0.00 sec) mysql sql database share|improve this question asked Dec 12 '11 at 8:43 Mellon 9,85746141226 add a comment| 2 Answers 2 active oldest votes up vote 7 down vote accepted Have a look
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn
Error 29 (hy000) File Relay-bin Not Found (errcode 2)
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags file './mysql/user.myd' not found Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like error 29 hy000 file not found errcode 13 permission denied you, helping each other. Join them; it only takes a minute: Sign up load data local infile ERROR 2 file not found up vote 5 down vote favorite I've been ramming my face against this sql error for http://stackoverflow.com/questions/8471727/load-data-infile-does-not-work about 45 minutes, and I have a feeling it's going to be something silly. I'm trying to load a .txt file into my database, which is on a server elsewhere. I'm using putty on windows 7. The sql call I am using is the following: LOAD DATA LOCAL INFILE "C:/Users/Sam/Desktop/students_data.txt" INTO TABLE students; The response I get is ERROR 2 (HYOOO): File 'C:/Users/Sam/Desktop/students_data.txt' not found (Errcode:2) If anyone could shed some light on this that'd be http://stackoverflow.com/questions/7623984/load-data-local-infile-error-2-file-not-found extravagant. I already tried switching the / to \ and using single quotes, etc., but nothing seems to work. The file path is copied by shift+clicking the actual file and pasting it. mysql load share|improve this question asked Oct 2 '11 at 1:08 samuel 1011112 add a comment| 4 Answers 4 active oldest votes up vote 3 down vote I have found a solution. First delete the word LOCAL from the sql statement. Second - place your file into MySQL DATA folder usually - bin/mysql/msql5.5.8/data/and your DB with which you are working. It worked for me. You might want to check your MAX_FILE upload number in php.ini file if file is large. share|improve this answer answered Dec 16 '11 at 3:38 prkarpi 362 i am working with MySQL and the first solution is okay.. but why we need php.ini file and where can i found php.ini, @prkarpi –saikiran May 13 '14 at 13:05 Have done the above procedure still facing the error.. given file permissions to full control and copied file to c>programdata>mysql>mysqlserver 5.6>data>sample . please help. –saikiran May 13 '14 at 13:19 my file is nearly has 2 GB of data. –saikiran May 13 '14 at 13:19 add a comment| up vote 2 down vote Removing the word LOCAL seemed to work for me; try it out! sh
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of http://stackoverflow.com/questions/12421312/mysql-load-data-infile this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up not found MySQL : Load data infile up vote 6 down vote favorite 3 I am getting error when using load data to insert the query . "load data infile '/home/bharathi/out.txt' into table Summary" This file is there in the location . But mysql throws the below error . ERROR 29 (HY000): File '/home/bharathi/out.txt' not found (Errcode: 13) show variables like 'data%'; +---------------+-----------------+ | Variable_name file not found | Value | +---------------+-----------------+ | datadir | /var/lib/mysql/ | +---------------+-----------------+ Data Dir is pointing to root permissioned folder . I can't change this variable because it's readonly . How can I do the load data infile operation ? I tried changing file permissions , load data local infile . It wont work . mysql share|improve this question asked Sep 14 '12 at 9:05 kannanrbk 2,06962662 On which system (server or client) is the file? –eggyal Sep 14 '12 at 9:10 Server And Client or same machine . –kannanrbk Sep 14 '12 at 9:15 add a comment| 2 Answers 2 active oldest votes up vote 11 down vote accepted As documented under LOAD DATA INFILE Syntax: 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. See Section 6.2.1, “Privileges Provided by MySQL”. For non-LOCAL load operations, if the secure_file_priv system variable is set to a nonempty directory name, the file to be loaded m