Error 2 Hy000
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 about Stack Overflow the company Business mysql load data infile file not found windows Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Error 29 (hy000): File Not Found (errcode: 13)
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just
Error 2 Hy000 File Not Found Errcode 2 No Such File Or Directory
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 1 I am running MySQL on my Ubuntu machine. I checked
Error 1148 (42000):
/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 copied the above students.dat file to /tmp directory. Then, I run the following command to load the mysql error code 2 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,76246139226 add a comment| 2 Answers 2 active oldest votes up vote 7 down vote accepted Have a look at the sixth post from file not found error. It seems if you specify LOAD DATA LOCAL INFILE should work (They added the LOCAL keyword) share|improve this answer answered Dec 12 '11 at
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 error 29 (hy000) file relay-bin not found (errcode 2) About Us Learn more about Stack Overflow the company Business Learn more about load data infile error 13 hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss error 29 hy000 file not found errcode 13 permission denied Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up mysql: SOURCE error http://stackoverflow.com/questions/8471727/load-data-infile-does-not-work 2? up vote 30 down vote favorite 2 When I tried to source for a particular .sql file, namely 'metropolises.sql' that I created and saved previously from a database, the following error is displayed: Failed to open file 'metropolises.sql', error: 2 Any idea what went wrong? mysql share|improve this question edited Feb 4 '13 at 9:48 asked Feb 4 '13 at 9:46 Clueless Gorilla 3192511 http://stackoverflow.com/questions/14684063/mysql-source-error-2 1 What does it mean to "try to source for a particuar .sql file"? –Lightness Races in Orbit Feb 4 '13 at 9:51 1 Did you mean "search"? –veljasije Feb 4 '13 at 9:54 I created a table in a database. Now, in order to get the data created, I typed SOURCE metropolises.sql; into the terminal, however the error message as described above showed up. Pretty sure there's no error in the table created. –Clueless Gorilla Feb 4 '13 at 10:22 add a comment| 12 Answers 12 active oldest votes up vote 49 down vote Assuming you mean that you are trying to use the source command in order to execute SQL statements from a text file, the error number given appears to be passed through from the POSIX layer. Therefore, using this resource, we can deduce that the error value of 2 means "no such file or directory". In short, you got the path wrong. Try providing an absolute path, as it's not clear what the current working directory will be in the context of your MySQL server. You may be assuming that it's the working directory of
log in tour help Tour Start 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 http://dba.stackexchange.com/questions/55960/mysql-import-csv-file-error-13-hy000-cant-get-stat-of-path-file-csv-errcod Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a http://forums.mysql.com/read.php?10,376945 question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: error 2 Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top MySQL import csv file ERROR 13 (HY000): Can't get stat of /path/file.csv (Errcode: 2) up vote 6 down vote favorite 6 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 file not found 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 mysql errors csv-file share|improve this question edited Jan 2 '14 at 5:50 asked Jan 2 '14 at 5:17 Guillermo 33114 add a comment| 2 Answers 2 active oldest votes up vote 14 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
Community Podcasts MySQL.com Downloads Documentation Section Menu: MySQL Forums :: Newbie :: To solve ERROR 2 (HY000): File '/