Re: Error 1013
Le Saturday 17 December 2005 04:54, Karl Krelove(Karl Krelove [EMAIL PROTECTED]) disait: Hello, LOAD DATA INFILE 'home/karl/Student_List.csv' into table ^^^ student_list FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n'; In response I get: ERROR 13 (HY000): Can't get stat of ^^ '/var/lib/mysql/home/karl/Student_List.csv' (Errcode: 2) ^^ Are you sure that the path to file is correct? What des '\! ls home/karl/Student_List.csv' under mysql cli utility return? -- Glennie La vie offre toujours deux pentes. On grimpe ou on se laisse glisser. pgpeHd8Y2Gmeh.pgp Description: PGP signature
Re: Error 1013
Karl Krelove wrote: I'm trying to import a large amount of data from an Access database containing information about 9,000+ students in a school system. I've created a table 'student_list' to hold the data and issued the following command: LOAD DATA INFILE 'home/karl/Student_List.csv' into table student_list FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n'; In response I get: ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/home/karl/Student_List.csv' (Errcode: 2) I've looked up the error on the MySQL website and found the error listed as Error 1013 in the listing of server errors for MySQL 4.1, but I can't find an explanation. 1st question - the obvious one - does anyone know what is triggering the error? 2nd question - why does MySQL only list the errors? I could already read what it said in the CLI client. Is there a place on the web site that actually explains what specific errors mean? Thanks in advance for any input. Karl Krelove Hi Karl, Do you have your home directories under the mysql path? When you are doing a LOAD DATA INFILE the following rules (from the manual) apply to the pathname When locating files on the server host, the server uses the following rules: * If an absolute pathname is given, the server uses the pathname as is. * If a relative pathname with one or more leading components is given, the server searches for the file relative to the server's data directory. * If a filename with no leading components is given, the server looks for the file in the database directory of the default database. Note that these rules mean that a file named as |./myfile.txt| is read from the server's data directory, whereas the same file named as |myfile.txt| is read from the database directory of the default database. For example, the following |LOAD DATA| statement reads the file |data.txt| from the database directory for |db1| because |db1| is the current database, even though the statement explicitly loads the file into a table in the |db2| database: mysql *|USE db1;|* mysql *|LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;|* Note that Windows pathnames are specified using forward slashes rather than backslashes. If you do use backslashes, you must double them. 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. I suspect, based on these rules, it will be looking for the file relative to /var/lib/mysql as it states in the error message. Further info is available at http://dev.mysql.com/doc/refman/5.0/en/load-data.html Regards -- David Logan South Australia when in trouble, or in doubt run in circles, scream and shout -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Error 1013
David Logan wrote: Karl Krelove wrote: I'm trying to import a large amount of data from an Access database containing information about 9,000+ students in a school system. I've created a table 'student_list' to hold the data and issued the following command: LOAD DATA INFILE 'home/karl/Student_List.csv' into table student_list FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n'; In response I get: ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/home/karl/Student_List.csv' (Errcode: 2) I've looked up the error on the MySQL website and found the error listed as Error 1013 in the listing of server errors for MySQL 4.1, but I can't find an explanation. 1st question - the obvious one - does anyone know what is triggering the error? 2nd question - why does MySQL only list the errors? I could already read what it said in the CLI client. Is there a place on the web site that actually explains what specific errors mean? Thanks in advance for any input. Karl Krelove Hi Karl, Do you have your home directories under the mysql path? When you are doing a LOAD DATA INFILE the following rules (from the manual) apply to the pathname large snip I suspect, based on these rules, it will be looking for the file relative to /var/lib/mysql as it states in the error message. Further info is available at http://dev.mysql.com/doc/refman/5.0/en/load-data.html Regards My first reaction as I read your response was But I had just run a LOAD INFILE command on another table from the same database - same directory, same command, nothing different except the filename and the table name - with no path problem. Then I looked a little closer at the LOAD INFILE I pasted into this message. What a difference a single slash can make! When I re-ran the command in MySQL using the same path but with a slash at the _beginning_ - '/home/karl/Student_List.csv' - it worked and the data was imported in about a hundredth of a second! Thanks for pointing me toward a path problem. Does Can't get stat translate to File not found? And as for my other general question, is there a resource online (or even in a bound manual) that actually explains MySQL error messages? There is that huge listing on the MySQL website that _lists_ a gazillion errors and their numeric codes, but no links to explanations. Thanks again. Karl
Re: Error 1013
Karl Krelove wrote: David Logan wrote: Karl Krelove wrote: I'm trying to import a large amount of data from an Access database containing information about 9,000+ students in a school system. I've created a table 'student_list' to hold the data and issued the following command: LOAD DATA INFILE 'home/karl/Student_List.csv' into table student_list FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n'; In response I get: ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/home/karl/Student_List.csv' (Errcode: 2) I've looked up the error on the MySQL website and found the error listed as Error 1013 in the listing of server errors for MySQL 4.1, but I can't find an explanation. 1st question - the obvious one - does anyone know what is triggering the error? 2nd question - why does MySQL only list the errors? I could already read what it said in the CLI client. Is there a place on the web site that actually explains what specific errors mean? Thanks in advance for any input. Karl Krelove Hi Karl, Do you have your home directories under the mysql path? When you are doing a LOAD DATA INFILE the following rules (from the manual) apply to the pathname large snip I suspect, based on these rules, it will be looking for the file relative to /var/lib/mysql as it states in the error message. Further info is available at http://dev.mysql.com/doc/refman/5.0/en/load-data.html Regards My first reaction as I read your response was But I had just run a LOAD INFILE command on another table from the same database - same directory, same command, nothing different except the filename and the table name - with no path problem. Then I looked a little closer at the LOAD INFILE I pasted into this message. What a difference a single slash can make! When I re-ran the command in MySQL using the same path but with a slash at the _beginning_ - '/home/karl/Student_List.csv' - it worked and the data was imported in about a hundredth of a second! Thanks for pointing me toward a path problem. Does Can't get stat translate to File not found? And as for my other general question, is there a resource online (or even in a bound manual) that actually explains MySQL error messages? There is that huge listing on the MySQL website that _lists_ a gazillion errors and their numeric codes, but no links to explanations. Thanks again. Karl Hi Karl, There are many many error codes unfortunately. I don't know of any specific resource, however in the manual there are a couple of the appendices that can be very useful, appendix A especially. I find that I just have to read the manual for the command that I have issues with otherwise. Can't get stat indeed means as you thought. A stat is a unix system function that returns details on the file, eg: ownership, group, size, date last modified etc. It is telling you it can't find it to retrieve the info required. Pleased to see it all worked ok. Regards -- David Logan South Australia when in trouble, or in doubt run in circles, scream and shout -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Error 1013
I'm trying to import a large amount of data from an Access database containing information about 9,000+ students in a school system. I've created a table 'student_list' to hold the data and issued the following command: LOAD DATA INFILE 'home/karl/Student_List.csv' into table student_list FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n'; In response I get: ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/home/karl/Student_List.csv' (Errcode: 2) I've looked up the error on the MySQL website and found the error listed as Error 1013 in the listing of server errors for MySQL 4.1, but I can't find an explanation. 1st question - the obvious one - does anyone know what is triggering the error? 2nd question - why does MySQL only list the errors? I could already read what it said in the CLI client. Is there a place on the web site that actually explains what specific errors mean? Thanks in advance for any input. Karl Krelove -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]