Error 2 Hy000 At Line 1 File
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and failed to open file error 2 mysql linux policies of this site About Us Learn more about Stack Overflow the company mysql load data infile file not found windows Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users failed to open file error 2 mysql ubuntu Badges Ask Question x Dismiss 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 https://groups.google.com/d/topic/stacks-users/4v9luwHFGng 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 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 http://stackoverflow.com/questions/7623984/load-data-local-infile-error-2-file-not-found 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 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 n
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 http://stackoverflow.com/questions/14684063/mysql-source-error-2 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 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up mysql: SOURCE error 2? up vote 30 down vote favorite error 2 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 1 What does it mean to "try to source for failed to open 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 your shell, but it's not obvious that we should expect this to be true. share|improve this answer answered Feb 4