RE: Problem in using LOAD DATA LOCAL INFILE
Thanks for replaying That is what I am not able to figure out what to use in FIELDS TERMINATED BY, LINES TREMINATED BY My fields are terminated by Ü and my lines are terminated by '¢ and that I have clearly mentioned in my query LOAD DATA LOCAL INFILE 'd:\\data3.txt' INTO TABLE dsc FIELDS TERMINATED BY 'Ü\n' LINES TERMINATED BY '¢\n' (ch_code, name, info); The sample of text file is === Ü ¢ Ch.Code :02Ü MEATÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA Ü ¢ Ch.Code :03Ü FISHÜ 1 COUNTRY: JORDAN Ü ¢ Ch.Code :04Ü FISHÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA ... These are three records but there are more than 1000 records in my text file.. Can you help Cheers :-) Neeraj Black Bits _ From: Harish TM [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 9:54 PM To: sheeri kritzer Cc: Neeraj; mysql@lists.mysql.com Subject: Re: Problem in using LOAD DATA LOCAL INFILE You need to check your syntax. You probably don't have FIELDS TERMINATED BY and [OPTIONALLY] ENCLOSED BY and ESCAPED BY set correctly. True... those options are there for both LOAD DATA LOCAL INFILE and mysqlimport example: mysqlimport -u user -ppassword --local --fields-terminated-by='|' database file_to_import one thing here: if you are inserting the data into a table called TABLE then your file should be called TABLE.anything you like for LOAD DATA... : LOAD DATA LOCAL INFILE 'file with complete path INTO TABLE table FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n'; but the load data infile is messy especially if you installed MySql through the source files. Better if you did through binaries but still not too good. Unless you are going to use this load inside a program its probably better to go ahead with mysqlimport harish On 5/31/06, sheeri kritzer [EMAIL PROTECTED] wrote: You need to check your syntax. You probably don't have FIELDS TERMINATED BY and [OPTIONALLY] ENCLOSED BY and ESCAPED BY set correctly. http://dev.mysql.com/doc/refman/5.0/en/load-data.html -Sheeri On 5/31/06, Neeraj [EMAIL PROTECTED] wrote: Hi harish Thanks for reply By executing this query for this table I am not getting any error.. But I am getting wrong result. I have tried many combinations for LOAD DATA LOCAL INFILE but I am getting the results in two ways... 1. all the data getting loaded in first columns of first row. Or 2. data for all columns getting loaded in first column only and getting error line now data for other columns Hope you will find the solution Cheers.:) Neeraj Black Bits -Original Message- From: Harish TM [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Tuesday, May 30, 2006 10:23 PM To: sheeri kritzer Cc: Neeraj; mysql@lists.mysql.com Subject: Re: Problem in using LOAD DATA LOCAL INFILE I went through a lot of trouble with Load data local infile... There are a lot of things regarding Local that MySql does not allow due to security reasons. As mentioned before this you could give us the error... that might help alternatively try out mysqlimport http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html Its similar but a lot easier to use. However its a program so embedding it in code is not efficient.. hope this helps harish On 5/30/06, sheeri kritzer [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: What's the error you are getting? What MySQL version are you using? On 5/26/06, Neeraj [EMAIL PROTECTED] wrote: Hi all I have a table with following structure CREATE TABLE `dsc` ( `ch_code` varchar(255) default NULL, `name` varchar(255) default NULL, `inof` blob ) ENGINE=InnoDB DEFAULT CHARSET=latin1; And I have give a text file with following format Ü ¢ Ch.Code :02Ü MEATÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA Ü ¢ Ch.Code :03Ü FISHÜ 1 COUNTRY: JORDAN Ü ¢ Ch.Code :04Ü FISHÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA ... I am trying to import the text file into table. I have tried various ways but unable to find the solution. the code I am trying to import the file is as follows LOAD DATA LOCAL INFILE 'd:\\data3.txt' INTO TABLE dsc FIELDS TERMINATED BY 'Ü\n' LINES TERMINATED BY '¢\n' (ch_code, name, info); Can any one help me in loading this file Regards Neeraj Black Bits -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql
RE: Problem in using LOAD DATA LOCAL INFILE
Hi harish Thanks for reply By executing this query for this table I am not getting any error.. But I am getting wrong result. I have tried many combinations for LOAD DATA LOCAL INFILE but I am getting the results in two ways... 1. all the data getting loaded in first columns of first row. Or 2. data for all columns getting loaded in first column only and getting error line now data for other columns Hope you will find the solution Cheers.:) Neeraj Black Bits -Original Message- From: Harish TM [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 10:23 PM To: sheeri kritzer Cc: Neeraj; mysql@lists.mysql.com Subject: Re: Problem in using LOAD DATA LOCAL INFILE I went through a lot of trouble with Load data local infile... There are a lot of things regarding Local that MySql does not allow due to security reasons. As mentioned before this you could give us the error... that might help alternatively try out mysqlimport http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html Its similar but a lot easier to use. However its a program so embedding it in code is not efficient.. hope this helps harish On 5/30/06, sheeri kritzer [EMAIL PROTECTED] wrote: What's the error you are getting? What MySQL version are you using? On 5/26/06, Neeraj [EMAIL PROTECTED] wrote: Hi all I have a table with following structure CREATE TABLE `dsc` ( `ch_code` varchar(255) default NULL, `name` varchar(255) default NULL, `inof` blob ) ENGINE=InnoDB DEFAULT CHARSET=latin1; And I have give a text file with following format Ü ¢ Ch.Code :02Ü MEATÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA Ü ¢ Ch.Code :03Ü FISHÜ 1 COUNTRY: JORDAN Ü ¢ Ch.Code :04Ü FISHÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA ... I am trying to import the text file into table. I have tried various ways but unable to find the solution. the code I am trying to import the file is as follows LOAD DATA LOCAL INFILE 'd:\\data3.txt' INTO TABLE dsc FIELDS TERMINATED BY 'Ü\n' LINES TERMINATED BY '¢\n' (ch_code, name, info); Can any one help me in loading this file Regards Neeraj Black Bits -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Problem in using LOAD DATA LOCAL INFILE
You need to check your syntax. You probably don't have FIELDS TERMINATED BY and [OPTIONALLY] ENCLOSED BY and ESCAPED BY set correctly. http://dev.mysql.com/doc/refman/5.0/en/load-data.html -Sheeri On 5/31/06, Neeraj [EMAIL PROTECTED] wrote: Hi harish Thanks for reply By executing this query for this table I am not getting any error.. But I am getting wrong result. I have tried many combinations for LOAD DATA LOCAL INFILE but I am getting the results in two ways... 1. all the data getting loaded in first columns of first row. Or 2. data for all columns getting loaded in first column only and getting error line now data for other columns Hope you will find the solution Cheers.:) Neeraj Black Bits -Original Message- From: Harish TM [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 10:23 PM To: sheeri kritzer Cc: Neeraj; mysql@lists.mysql.com Subject: Re: Problem in using LOAD DATA LOCAL INFILE I went through a lot of trouble with Load data local infile... There are a lot of things regarding Local that MySql does not allow due to security reasons. As mentioned before this you could give us the error... that might help alternatively try out mysqlimport http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html Its similar but a lot easier to use. However its a program so embedding it in code is not efficient.. hope this helps harish On 5/30/06, sheeri kritzer [EMAIL PROTECTED] wrote: What's the error you are getting? What MySQL version are you using? On 5/26/06, Neeraj [EMAIL PROTECTED] wrote: Hi all I have a table with following structure CREATE TABLE `dsc` ( `ch_code` varchar(255) default NULL, `name` varchar(255) default NULL, `inof` blob ) ENGINE=InnoDB DEFAULT CHARSET=latin1; And I have give a text file with following format Ü ¢ Ch.Code :02Ü MEATÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA Ü ¢ Ch.Code :03Ü FISHÜ 1 COUNTRY: JORDAN Ü ¢ Ch.Code :04Ü FISHÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA ... I am trying to import the text file into table. I have tried various ways but unable to find the solution. the code I am trying to import the file is as follows LOAD DATA LOCAL INFILE 'd:\\data3.txt' INTO TABLE dsc FIELDS TERMINATED BY 'Ü\n' LINES TERMINATED BY '¢\n' (ch_code, name, info); Can any one help me in loading this file… Regards Neeraj Black Bits -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Problem in using LOAD DATA LOCAL INFILE
You need to check your syntax. You probably don't have FIELDS TERMINATED BY and [OPTIONALLY] ENCLOSED BY and ESCAPED BY set correctly. True... those options are there for both LOAD DATA LOCAL INFILE and mysqlimport example: mysqlimport -u user -ppassword --local --fields-terminated-by='|' database file_to_import one thing here: if you are inserting the data into a table called TABLE then your file should be called TABLE.anything you like for LOAD DATA... : LOAD DATA LOCAL INFILE 'file with complete path INTO TABLE table FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n'; but the load data infile is messy especially if you installed MySql through the source files. Better if you did through binaries but still not too good. Unless you are going to use this load inside a program its probably better to go ahead with mysqlimport harish On 5/31/06, sheeri kritzer [EMAIL PROTECTED] wrote: You need to check your syntax. You probably don't have FIELDS TERMINATED BY and [OPTIONALLY] ENCLOSED BY and ESCAPED BY set correctly. http://dev.mysql.com/doc/refman/5.0/en/load-data.html -Sheeri On 5/31/06, Neeraj [EMAIL PROTECTED] wrote: Hi harish Thanks for reply By executing this query for this table I am not getting any error.. But I am getting wrong result. I have tried many combinations for LOAD DATA LOCAL INFILE but I am getting the results in two ways... 1. all the data getting loaded in first columns of first row. Or 2. data for all columns getting loaded in first column only and getting error line now data for other columns Hope you will find the solution Cheers.:) Neeraj Black Bits -Original Message- From: Harish TM [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 10:23 PM To: sheeri kritzer Cc: Neeraj; mysql@lists.mysql.com Subject: Re: Problem in using LOAD DATA LOCAL INFILE I went through a lot of trouble with Load data local infile... There are a lot of things regarding Local that MySql does not allow due to security reasons. As mentioned before this you could give us the error... that might help alternatively try out mysqlimport http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html Its similar but a lot easier to use. However its a program so embedding it in code is not efficient.. hope this helps harish On 5/30/06, sheeri kritzer [EMAIL PROTECTED] wrote: What's the error you are getting? What MySQL version are you using? On 5/26/06, Neeraj [EMAIL PROTECTED] wrote: Hi all I have a table with following structure CREATE TABLE `dsc` ( `ch_code` varchar(255) default NULL, `name` varchar(255) default NULL, `inof` blob ) ENGINE=InnoDB DEFAULT CHARSET=latin1; And I have give a text file with following format Ü ¢ Ch.Code :02Ü MEATÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA Ü ¢ Ch.Code :03Ü FISHÜ 1 COUNTRY: JORDAN Ü ¢ Ch.Code :04Ü FISHÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA ... I am trying to import the text file into table. I have tried various ways but unable to find the solution. the code I am trying to import the file is as follows LOAD DATA LOCAL INFILE 'd:\\data3.txt' INTO TABLE dsc FIELDS TERMINATED BY 'Ü\n' LINES TERMINATED BY '¢\n' (ch_code, name, info); Can any one help me in loading this file… Regards Neeraj Black Bits -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Problem in using LOAD DATA LOCAL INFILE
What's the error you are getting? What MySQL version are you using? On 5/26/06, Neeraj [EMAIL PROTECTED] wrote: Hi all I have a table with following structure CREATE TABLE `dsc` ( `ch_code` varchar(255) default NULL, `name` varchar(255) default NULL, `inof` blob ) ENGINE=InnoDB DEFAULT CHARSET=latin1; And I have give a text file with following format Ü ¢ Ch.Code :02Ü MEATÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA Ü ¢ Ch.Code :03Ü FISHÜ 1 COUNTRY: JORDAN Ü ¢ Ch.Code :04Ü FISHÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA ... I am trying to import the text file into table. I have tried various ways but unable to find the solution. the code I am trying to import the file is as follows LOAD DATA LOCAL INFILE 'd:\\data3.txt' INTO TABLE dsc FIELDS TERMINATED BY 'Ü\n' LINES TERMINATED BY '¢\n' (ch_code, name, info); Can any one help me in loading this file… Regards Neeraj Black Bits -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Problem in using LOAD DATA LOCAL INFILE
Hi all I have a table with following structure CREATE TABLE `dsc` ( `ch_code` varchar(255) default NULL, `name` varchar(255) default NULL, `inof` blob ) ENGINE=InnoDB DEFAULT CHARSET=latin1; And I have give a text file with following format Ü ¢ Ch.Code :02Ü MEATÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA Ü ¢ Ch.Code :03Ü FISHÜ 1 COUNTRY: JORDAN Ü ¢ Ch.Code :04Ü FISHÜ 1 COUNTRY: JORDAN 2 COUNTRY: SAUDI ARABIA ... I am trying to import the text file into table. I have tried various ways but unable to find the solution. the code I am trying to import the file is as follows LOAD DATA LOCAL INFILE 'd:\\data3.txt' INTO TABLE dsc FIELDS TERMINATED BY 'Ü\n' LINES TERMINATED BY '¢\n' (ch_code, name, info); Can any one help me in loading this file Regards Neeraj Black Bits
LOAD DATA LOCAL INFILE
Hi! Can someone point me in the right direction? I have this that works in v.4x: $sql = LOAD DATA LOCAL INFILE '$file' REPLACE INTO TABLE `members` FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '' LINES TERMINATED BY '\\r\\n'; When I try it using 3.23.55 I get the following error: #1148 - The used command is not allowed with this MySQL version Is there any way I can make this work using 3.23.55? TIA! R. Whitney Transcend Development Producing the next phase of your internet presence http://xend.net Premium Quality Web Hosting http://hosting.xend.net [EMAIL PROTECTED] 310-943-6498 602-288-5340 The day this country abandons God is the day God will abandon this country Linux is like a wigwam, no windows, no gates, apache inside. - borrowed from Sharon Kimble off of the Fedora mailing list -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: LOAD DATA LOCAL INFILE
Hi Richard, Try looking at mysqlimport instead. I'm only taking a punt that it works with that version but the manual doesn't say anything about it being since a certain version. It works as at 3.23.58 so hopefully it may do for .55 Regards David Logan Database Administrator HP Managed Services 148 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Richard Whitney [mailto:[EMAIL PROTECTED] Sent: Thursday, 28 October 2004 10:37 AM To: [EMAIL PROTECTED] Subject: LOAD DATA LOCAL INFILE Hi! Can someone point me in the right direction? I have this that works in v.4x: $sql = LOAD DATA LOCAL INFILE '$file' REPLACE INTO TABLE `members` FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '' LINES TERMINATED BY '\\r\\n'; When I try it using 3.23.55 I get the following error: #1148 - The used command is not allowed with this MySQL version Is there any way I can make this work using 3.23.55? TIA! R. Whitney Transcend Development Producing the next phase of your internet presence http://xend.net Premium Quality Web Hosting http://hosting.xend.net [EMAIL PROTECTED] 310-943-6498 602-288-5340 The day this country abandons God is the day God will abandon this country Linux is like a wigwam, no windows, no gates, apache inside. - borrowed from Sharon Kimble off of the Fedora mailing list -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE
Richard Whitney wrote: Hi! Can someone point me in the right direction? I have this that works in v.4x: $sql = LOAD DATA LOCAL INFILE '$file' REPLACE INTO TABLE `members` FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '' LINES TERMINATED BY '\\r\\n'; When I try it using 3.23.55 I get the following error: #1148 - The used command is not allowed with this MySQL version Is there any way I can make this work using 3.23.55? TIA! R. Whitney Transcend Development Producing the next phase of your internet presence http://xend.net Premium Quality Web Hosting http://hosting.xend.net [EMAIL PROTECTED] 310-943-6498 602-288-5340 The day this country abandons God is the day God will abandon this country Linux is like a wigwam, no windows, no gates, apache inside. - borrowed from Sharon Kimble off of the Fedora mailing list Someone else had asked about the LOAD DATA syntax earlier this morning and getting the same error message that you're getting and one of the Ensita guys responded with this link: http://dev.mysql.com/doc/mysql/en/LOAD_DATA_LOCAL.html It looks like you might fall into the MySQL version discussed in the link. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Replication and LOAD DATA LOCAL INFILE
My best guess would be that your slave tables have slightly different data/structure than your master table. Try taking a fresh snapshot from the master and trying again. -Eric On Tue, 12 Oct 2004 10:33:24 -0700, Kenneth Lim [EMAIL PROTECTED] wrote: Hi - I'm seeing these error/warning messages on my replication slave: [ERROR] Slave: load data infile on table 'DeviceItem' at log position 38844696 in log 'db1-bin.01' produced 6 warning(s). Default database: 'senvidsysdb' I was wondering if anyone has seen similar messages. I have master-slave replication setup on 2 Linux boxes running MySQL 4.1.5-gamma. On a Windows client, I execute a script that contains a bunch of LOAD DATA LOCAL INFILE statements. The master error log does not complain. But the slave error log has the error/warning messages above. The data seems to be the same on master and slave. Are there special considerations for using LOAD DATA LOCAL INFILE statements with a replication setup? Thanks. -ken Kenneth Lim Software Engineer Senvid, Inc. 2445 Faber Place, Suite #200 Palo Alto, CA 94303 phone: 650-354-3612 fax: 650-354-8890 email: [EMAIL PROTECTED] http://www.senvid.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- Eric Bergen [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Replication and LOAD DATA LOCAL INFILE
Hi - I'm seeing these error/warning messages on my replication slave: [ERROR] Slave: load data infile on table 'DeviceItem' at log position 38844696 in log 'db1-bin.01' produced 6 warning(s). Default database: 'senvidsysdb' I was wondering if anyone has seen similar messages. I have master-slave replication setup on 2 Linux boxes running MySQL 4.1.5-gamma. On a Windows client, I execute a script that contains a bunch of LOAD DATA LOCAL INFILE statements. The master error log does not complain. But the slave error log has the error/warning messages above. The data seems to be the same on master and slave. Are there special considerations for using LOAD DATA LOCAL INFILE statements with a replication setup? Thanks. -ken Kenneth Lim Software Engineer Senvid, Inc. 2445 Faber Place, Suite #200 Palo Alto, CA 94303 phone: 650-354-3612 fax: 650-354-8890 email: [EMAIL PROTECTED] http://www.senvid.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: LOAD DATA LOCAL INFILE issue
Hi Michael, Yes, I rebuilt it to ensure it was switched on. The configure line was ./configure --enable-local-infile --without-server Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 August 2004 3:19 PM To: Logan, David (SST - Adelaide) Cc: MySQL List Subject: Re: LOAD DATA LOCAL INFILE issue Well, as you say, that error message means it's been disabled in either the client or the server. You rebuilt the server from source with --enable-local-infile, and the server says local-infile is ON. You've tried turning it on in the client with --local-infile, but you haven't mentioned whether the client was built with --enable-local-infile. I'm not sure the command line switch does any good if local-infile was disabled at build time. So, did you build the client with --enable-local-infile? Michael Logan, David (SST - Adelaide) wrote: Hi Michael, Thanks. I rechecked things but porkribs /u2/lcscreative/sql_scripts $ mysql --local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version Still a most unhappy camper. I had to resort to placing the file on the server, owned and group mysql in the datadir before it would work. Even though I did chmod 777 on the file, it was still upset. I am running Solaris 8 on the client and 9 on the server. I don't know whether this would make a difference, I can't understand why it would. Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 August 2004 2:37 PM To: Logan, David (SST - Adelaide) Cc: MySQL List Subject: Re: LOAD DATA LOCAL INFILE issue Perhaps the problem is that there is no such option as --enable-local-infile in the mysql client. I believe you want --local-infile. Client options are detailed in the manual http://dev.mysql.com/doc/mysql/en/mysql.html. Michael Logan, David (SST - Adelaide) wrote: Hi Folks, I am having a few issues with a LOAD DATA LOCAL INFILE command. As you can see by the command below, I am receiving an error 1148. The documentation states this is generally because I don't have --enable-local-infile on in both client and server. I have switched it on via command line below and when I do a show variables on the server, I see local-infile = ON. I have also tried loose-local-infile in the my.cnf on both client and server. I have just rebuilt the server ensuring --enable-local-infile was in the ./configure options. Both client and server are version 4.0.20 and are on different hosts. The sql file I am using is CREATE DATABASE IF NOT EXISTS weblog; use weblog; CREATE TABLE IF NOT EXISTS dept (department INT PRIMARY KEY, main_dept INT NOT NULL, description VARCHAR(40)); CREATE TABLE IF NOT EXISTS dns_cache (ip_address CHAR(15) NOT NULL PRIMARY KEY, hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS web_rec (recnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, date DATE NOT NULL, time TIME NOT NULL, source_ip CHAR(15) NOT NULL, method CHAR(10) NOT NULL, department INT, source_port SMALLINT NOT NULL, username VARCHAR(255), c_ip CHAR(15), user_agent VARCHAR(255), referrer TEXT, last_status SMALLINT, last_substatus SMALLINT, win32_status SMALLINT, sent_bytes INT, recv_bytes INT); CREATE TABLE IF NOT EXISTS UserAgent (agentnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, browser VARCHAR(255), description VARCHAR(255)); CREATE TABLE IF NOT EXISTS Referrer (Refnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ref_uri VARCHAR(255), hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS status (status INT NOT NULL PRIMARY KEY, description VARCHAR(255)); LOAD DATA LOCAL INFILE '/u2/lcscreative/sql_scripts/categories.csv' --- Line 46, error 1148 occurs here INTO TABLE dept FIELDS TERMINATED BY ',' ENCLOSED BY '' (main_dept,department,description); porkribs /u2/lcscreative/sql_scripts $ mysql --enable-local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version porkribs /u2/lcscreative/sql_scripts $ Anybody have any ideas on what I've done wrong? Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax
LOAD DATA LOCAL INFILE issue
Hi Folks, I am having a few issues with a LOAD DATA LOCAL INFILE command. As you can see by the command below, I am receiving an error 1148. The documentation states this is generally because I don't have --enable-local-infile on in both client and server. I have switched it on via command line below and when I do a show variables on the server, I see local-infile = ON. I have also tried loose-local-infile in the my.cnf on both client and server. I have just rebuilt the server ensuring --enable-local-infile was in the ./configure options. Both client and server are version 4.0.20 and are on different hosts. The sql file I am using is CREATE DATABASE IF NOT EXISTS weblog; use weblog; CREATE TABLE IF NOT EXISTS dept (department INT PRIMARY KEY, main_dept INT NOT NULL, description VARCHAR(40)); CREATE TABLE IF NOT EXISTS dns_cache (ip_address CHAR(15) NOT NULL PRIMARY KEY, hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS web_rec (recnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, date DATE NOT NULL, time TIME NOT NULL, source_ip CHAR(15) NOT NULL, method CHAR(10) NOT NULL, department INT, source_port SMALLINT NOT NULL, username VARCHAR(255), c_ip CHAR(15), user_agent VARCHAR(255), referrer TEXT, last_status SMALLINT, last_substatus SMALLINT, win32_status SMALLINT, sent_bytes INT, recv_bytes INT); CREATE TABLE IF NOT EXISTS UserAgent (agentnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, browser VARCHAR(255), description VARCHAR(255)); CREATE TABLE IF NOT EXISTS Referrer (Refnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ref_uri VARCHAR(255), hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS status (status INT NOT NULL PRIMARY KEY, description VARCHAR(255)); LOAD DATA LOCAL INFILE '/u2/lcscreative/sql_scripts/categories.csv' --- Line 46, error 1148 occurs here INTO TABLE dept FIELDS TERMINATED BY ',' ENCLOSED BY '' (main_dept,department,description); porkribs /u2/lcscreative/sql_scripts $ mysql --enable-local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version porkribs /u2/lcscreative/sql_scripts $ Anybody have any ideas on what I've done wrong? Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax
Re: LOAD DATA LOCAL INFILE issue
Perhaps the problem is that there is no such option as --enable-local-infile in the mysql client. I believe you want --local-infile. Client options are detailed in the manual http://dev.mysql.com/doc/mysql/en/mysql.html. Michael Logan, David (SST - Adelaide) wrote: Hi Folks, I am having a few issues with a LOAD DATA LOCAL INFILE command. As you can see by the command below, I am receiving an error 1148. The documentation states this is generally because I don't have --enable-local-infile on in both client and server. I have switched it on via command line below and when I do a show variables on the server, I see local-infile = ON. I have also tried loose-local-infile in the my.cnf on both client and server. I have just rebuilt the server ensuring --enable-local-infile was in the ./configure options. Both client and server are version 4.0.20 and are on different hosts. The sql file I am using is CREATE DATABASE IF NOT EXISTS weblog; use weblog; CREATE TABLE IF NOT EXISTS dept (department INT PRIMARY KEY, main_dept INT NOT NULL, description VARCHAR(40)); CREATE TABLE IF NOT EXISTS dns_cache (ip_address CHAR(15) NOT NULL PRIMARY KEY, hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS web_rec (recnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, date DATE NOT NULL, time TIME NOT NULL, source_ip CHAR(15) NOT NULL, method CHAR(10) NOT NULL, department INT, source_port SMALLINT NOT NULL, username VARCHAR(255), c_ip CHAR(15), user_agent VARCHAR(255), referrer TEXT, last_status SMALLINT, last_substatus SMALLINT, win32_status SMALLINT, sent_bytes INT, recv_bytes INT); CREATE TABLE IF NOT EXISTS UserAgent (agentnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, browser VARCHAR(255), description VARCHAR(255)); CREATE TABLE IF NOT EXISTS Referrer (Refnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ref_uri VARCHAR(255), hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS status (status INT NOT NULL PRIMARY KEY, description VARCHAR(255)); LOAD DATA LOCAL INFILE '/u2/lcscreative/sql_scripts/categories.csv' --- Line 46, error 1148 occurs here INTO TABLE dept FIELDS TERMINATED BY ',' ENCLOSED BY '' (main_dept,department,description); porkribs /u2/lcscreative/sql_scripts $ mysql --enable-local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version porkribs /u2/lcscreative/sql_scripts $ Anybody have any ideas on what I've done wrong? Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: LOAD DATA LOCAL INFILE issue
Hi Michael, Thanks. I rechecked things but porkribs /u2/lcscreative/sql_scripts $ mysql --local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version Still a most unhappy camper. I had to resort to placing the file on the server, owned and group mysql in the datadir before it would work. Even though I did chmod 777 on the file, it was still upset. I am running Solaris 8 on the client and 9 on the server. I don't know whether this would make a difference, I can't understand why it would. Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 August 2004 2:37 PM To: Logan, David (SST - Adelaide) Cc: MySQL List Subject: Re: LOAD DATA LOCAL INFILE issue Perhaps the problem is that there is no such option as --enable-local-infile in the mysql client. I believe you want --local-infile. Client options are detailed in the manual http://dev.mysql.com/doc/mysql/en/mysql.html. Michael Logan, David (SST - Adelaide) wrote: Hi Folks, I am having a few issues with a LOAD DATA LOCAL INFILE command. As you can see by the command below, I am receiving an error 1148. The documentation states this is generally because I don't have --enable-local-infile on in both client and server. I have switched it on via command line below and when I do a show variables on the server, I see local-infile = ON. I have also tried loose-local-infile in the my.cnf on both client and server. I have just rebuilt the server ensuring --enable-local-infile was in the ./configure options. Both client and server are version 4.0.20 and are on different hosts. The sql file I am using is CREATE DATABASE IF NOT EXISTS weblog; use weblog; CREATE TABLE IF NOT EXISTS dept (department INT PRIMARY KEY, main_dept INT NOT NULL, description VARCHAR(40)); CREATE TABLE IF NOT EXISTS dns_cache (ip_address CHAR(15) NOT NULL PRIMARY KEY, hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS web_rec (recnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, date DATE NOT NULL, time TIME NOT NULL, source_ip CHAR(15) NOT NULL, method CHAR(10) NOT NULL, department INT, source_port SMALLINT NOT NULL, username VARCHAR(255), c_ip CHAR(15), user_agent VARCHAR(255), referrer TEXT, last_status SMALLINT, last_substatus SMALLINT, win32_status SMALLINT, sent_bytes INT, recv_bytes INT); CREATE TABLE IF NOT EXISTS UserAgent (agentnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, browser VARCHAR(255), description VARCHAR(255)); CREATE TABLE IF NOT EXISTS Referrer (Refnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ref_uri VARCHAR(255), hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS status (status INT NOT NULL PRIMARY KEY, description VARCHAR(255)); LOAD DATA LOCAL INFILE '/u2/lcscreative/sql_scripts/categories.csv' --- Line 46, error 1148 occurs here INTO TABLE dept FIELDS TERMINATED BY ',' ENCLOSED BY '' (main_dept,department,description); porkribs /u2/lcscreative/sql_scripts $ mysql --enable-local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version porkribs /u2/lcscreative/sql_scripts $ Anybody have any ideas on what I've done wrong? Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE issue
Well, as you say, that error message means it's been disabled in either the client or the server. You rebuilt the server from source with --enable-local-infile, and the server says local-infile is ON. You've tried turning it on in the client with --local-infile, but you haven't mentioned whether the client was built with --enable-local-infile. I'm not sure the command line switch does any good if local-infile was disabled at build time. So, did you build the client with --enable-local-infile? Michael Logan, David (SST - Adelaide) wrote: Hi Michael, Thanks. I rechecked things but porkribs /u2/lcscreative/sql_scripts $ mysql --local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version Still a most unhappy camper. I had to resort to placing the file on the server, owned and group mysql in the datadir before it would work. Even though I did chmod 777 on the file, it was still upset. I am running Solaris 8 on the client and 9 on the server. I don't know whether this would make a difference, I can't understand why it would. Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 August 2004 2:37 PM To: Logan, David (SST - Adelaide) Cc: MySQL List Subject: Re: LOAD DATA LOCAL INFILE issue Perhaps the problem is that there is no such option as --enable-local-infile in the mysql client. I believe you want --local-infile. Client options are detailed in the manual http://dev.mysql.com/doc/mysql/en/mysql.html. Michael Logan, David (SST - Adelaide) wrote: Hi Folks, I am having a few issues with a LOAD DATA LOCAL INFILE command. As you can see by the command below, I am receiving an error 1148. The documentation states this is generally because I don't have --enable-local-infile on in both client and server. I have switched it on via command line below and when I do a show variables on the server, I see local-infile = ON. I have also tried loose-local-infile in the my.cnf on both client and server. I have just rebuilt the server ensuring --enable-local-infile was in the ./configure options. Both client and server are version 4.0.20 and are on different hosts. The sql file I am using is CREATE DATABASE IF NOT EXISTS weblog; use weblog; CREATE TABLE IF NOT EXISTS dept (department INT PRIMARY KEY, main_dept INT NOT NULL, description VARCHAR(40)); CREATE TABLE IF NOT EXISTS dns_cache (ip_address CHAR(15) NOT NULL PRIMARY KEY, hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS web_rec (recnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, date DATE NOT NULL, time TIME NOT NULL, source_ip CHAR(15) NOT NULL, method CHAR(10) NOT NULL, department INT, source_port SMALLINT NOT NULL, username VARCHAR(255), c_ip CHAR(15), user_agent VARCHAR(255), referrer TEXT, last_status SMALLINT, last_substatus SMALLINT, win32_status SMALLINT, sent_bytes INT, recv_bytes INT); CREATE TABLE IF NOT EXISTS UserAgent (agentnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, browser VARCHAR(255), description VARCHAR(255)); CREATE TABLE IF NOT EXISTS Referrer (Refnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ref_uri VARCHAR(255), hostname VARCHAR(255)); CREATE TABLE IF NOT EXISTS status (status INT NOT NULL PRIMARY KEY, description VARCHAR(255)); LOAD DATA LOCAL INFILE '/u2/lcscreative/sql_scripts/categories.csv' --- Line 46, error 1148 occurs here INTO TABLE dept FIELDS TERMINATED BY ',' ENCLOSED BY '' (main_dept,department,description); porkribs /u2/lcscreative/sql_scripts $ mysql --enable-local-infile -u davidl -p make_web_tables.sql Enter password: ERROR 1148 at line 46: The used command is not allowed with this MySQL version porkribs /u2/lcscreative/sql_scripts $ Anybody have any ideas on what I've done wrong? Regards David Logan Database Administrator HP Managed Services 139 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
LOAD DATA LOCAL INFILE doesn't show in binlog
Hi, I'm running MySQL 3.23.52 with binary logging enabled. All commands seems to be written to the log except for LOAD DATA LOCAL INFILE. Is there a setting that needs to be tweaked for this to work? Thanks for your help, David _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE doesn't show in binlog
Not sure about the 3.x series, but in 4.x, if you build your own mysql, you need to explicitly enable that feature via a configure option. I think binary builds all have it enabled though. Issac - Original Message - From: David Brännlund [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 13, 2004 11:14 AM Subject: LOAD DATA LOCAL INFILE doesn't show in binlog Hi, I'm running MySQL 3.23.52 with binary logging enabled. All commands seems to be written to the log except for LOAD DATA LOCAL INFILE. Is there a setting that needs to be tweaked for this to work? Thanks for your help, David _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Load Data Local Infile confusion
Hello, I have a client that can connect to either a local or remote MySQL server. LOAD DATA INFILE works fine on a local server, but obviously fails when a remote server is used. When I add LOCAL to the command, I get: The used command is not allowed with this MySQL version I am using 4.0.18. The client is written using Delphi. What do I need to do to get this command to work with either server? Regards Dan --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.643 / Virus Database: 411 - Release Date: 3/25/2004 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
LOAD DATA LOCAL INFILE confusion
Hello, I have a client that can connect to either a local or remote MySQL server. LOAD DATA INFILE works fine on a local server, but obviously fails when a remote server is used. When I add LOCAL to the command, I get: The used command is not allowed with this MySQL version I am using 4.0.18. The client is written using Delphi. What do I need to do to get this command to work with either server? Regards Dan --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.643 / Virus Database: 411 - Release Date: 3/25/2004
Re: Load Data Local Infile problem
[EMAIL PROTECTED] wrote: I'm load a CSV file with five fields into mysql. It loads up fine. Problem comes in when I try to refresh the data with updates. I grab this file and convert it to CSV every 12 hours. The data shows past 24 hours only, so basically I'm trying to make a permanent archive. I tried creating a PRIMARY key of the first 4 fields to be unique to filter out duplicates. Problem is, when I have that key on, no new data gets written to the database, even clearly NEW records. Table is warlog, fields are time, attacker, coords, defender, status (obviously a game). A unique record would match the first four, or at the very least time and coords. Whenever I go to load data infile the second time around, no records get written if any indexes are present. If no indexes I get duplicates. If I put an index with the duplicates, I only get the first set of data with no updates. Is there something about primary keys I should know about? I've created this database with them and tried every combination, but I can't seem to get the update part to work. If you don't specify IGNORE or REPLACE keyword, LOAD DATA LOCAL works the same as IGNORE is specified. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile problem
This is from the manual. See the 3rd paragraph. The REPLACE and IGNORE keywords control handling of input records that duplicate existing records on unique key values. If you specify REPLACE, input rows replace existing rows (in other words rows that has the same value for a primary or unique index as an existing row). See section 6.4.7 REPLACE Syntax. If you specify IGNORE, input rows that duplicate an existing row on a unique key value are skipped. If you don't specify either option, the behavior depends on whether or not the LOCAL keyword is specified. Without LOCAL, an error occurs when a duplicate key value is found, and the rest of the text file is ignored. With LOCAL, the default behavior is the same as if IGNORE is specified; this is because the server has no way to stop transmission of the file in the middle of the operation. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Load Data Local Infile problem
I'm load a CSV file with five fields into mysql. It loads up fine. Problem comes in when I try to refresh the data with updates. I grab this file and convert it to CSV every 12 hours. The data shows past 24 hours only, so basically I'm trying to make a permanent archive. I tried creating a PRIMARY key of the first 4 fields to be unique to filter out duplicates. Problem is, when I have that key on, no new data gets written to the database, even clearly NEW records. Table is warlog, fields are time, attacker, coords, defender, status (obviously a game). A unique record would match the first four, or at the very least time and coords. Whenever I go to load data infile the second time around, no records get written if any indexes are present. If no indexes I get duplicates. If I put an index with the duplicates, I only get the first set of data with no updates. Is there something about primary keys I should know about? I've created this database with them and tried every combination, but I can't seem to get the update part to work. -- j http://decision.csl.uiuc.edu/~bambenek -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
LOAD DATA LOCAL INFILE
Hi all, How should I set the parameters of the LOAD DATA LOCAL INFILE command for a comma separated text file like this: Text field,.4,123 Text field with included quote,,45 Text field with , a comma between quotes,1.2,44 Thanks, Dan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: LOAD DATA LOCAL INFILE
From: Daniel Kiss [mailto:[EMAIL PROTECTED] Hi all, How should I set the parameters of the LOAD DATA LOCAL INFILE command for a comma separated text file like this: Text field,.4,123 Text field with included quote,,45 Text field with , a comma between quotes,1.2,44 I believe it's... LOAD DATA LOCAL INFILE '/path/to/file' INTO TABLE tablename FIELDS TERMINATED BY ',' OPTONALLY ENCLOSED BY ''; -- Mike Johnson Web Developer/Systems Asst. Smarter Living, Inc. phone (617) 497-2500 x226 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: LOAD DATA LOCAL INFILE
If it's an option, I would run your datafile through a processor (sed on unix, ultraedit on windows) to search and replace the string with \ and try it with fields terminated by ',' optionally enclosed by '' as mentioned by Mike Johnson's posting (escaped by '\' is default) -Original Message- From: Daniel Kiss [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 3:02 PM To: [EMAIL PROTECTED] Subject: LOAD DATA LOCAL INFILE Hi all, How should I set the parameters of the LOAD DATA LOCAL INFILE command for a comma separated text file like this: Text field,.4,123 Text field with included quote,,45 Text field with , a comma between quotes,1.2,44 Thanks, Dan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: LOAD DATA LOCAL INFILE
Thanks for the help. The problem was the line terminating character. My source files are in DOS format '\r\n' and not the default posix one '\n'. Thanks again. If it's an option, I would run your datafile through a processor (sed on unix, ultraedit on windows) to search and replace the string with \ and try it with fields terminated by ',' optionally enclosed by '' as mentioned by Mike Johnson's posting (escaped by '\' is default) -Original Message- From: Daniel Kiss [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 3:02 PM To: [EMAIL PROTECTED] Subject: LOAD DATA LOCAL INFILE Hi all, How should I set the parameters of the LOAD DATA LOCAL INFILE command for a comma separated text file like this: Text field,.4,123 Text field with included quote,,45 Text field with , a comma between quotes,1.2,44 Thanks, Dan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE question...
Egor, Thanks for the info. However, like I said, I already have local-infile=1 and set-variable = local-infile=1 in my my.ini on the server. I also have already done 'show variable like '%infile%' ' and receive local_infile ON in the result set. I run the command line client with --local-infile=1 I still receive the same error regardless of the configuration. -- R - Original Message - From: Egor Egorov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 22, 2003 5:25 AM Subject: Re: LOAD DATA LOCAL INFILE question... Robert [EMAIL PROTECTED] wrote: Having problems using 'LOAD DATA LOCAL INFILE' from a UNIX client talking to a Win32 server. I've read the documentation several times now and have had zero success with this command. You should run client and server with --local-infile option: http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE question...
Reverend Deuce [EMAIL PROTECTED] wrote: Egor, Thanks for the info. However, like I said, I already have local-infile=1 and set-variable = local-infile=1 in my my.ini on the server. I also have already done 'show variable like '%infile%' ' and receive local_infile ON in the result set. I run the command line client with --local-infile=1 I still receive the same error regardless of the configuration. Should work. What are the server and client versions? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE question...
Versions: Server is Win32 MySQL max 4.0.16 Client is FreeBSD MySQL 4.0.13 -- R Should work. What are the server and client versions? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE question...
Robert [EMAIL PROTECTED] wrote: Having problems using 'LOAD DATA LOCAL INFILE' from a UNIX client talking to a Win32 server. I've read the documentation several times now and have had zero success with this command. My server has the appropriate permissions configured in the MY.INI file (this was verified using 'show variables') as does my client on the UNIX system. I am attempting this using the root login to my server during testing. I receive the dreaded command not valid for this version of MySQL error. Server is Win32 MySQL max 4.0.16 Client is FreeBSD MySQL 4.0.13 You should run client and server with --local-infile option: http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
LOAD DATA LOCAL INFILE question...
Greetings, Having problems using 'LOAD DATA LOCAL INFILE' from a UNIX client talking to a Win32 server. I've read the documentation several times now and have had zero success with this command. My server has the appropriate permissions configured in the MY.INI file (this was verified using 'show variables') as does my client on the UNIX system. I am attempting this using the root login to my server during testing. I receive the dreaded command not valid for this version of MySQL error. Server is Win32 MySQL max 4.0.16 Client is FreeBSD MySQL 4.0.13 -- R. Deuce -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA LOCAL INFILE
Dear Bjoern, it is better to send all mailing list requests in english. Best regards Nils Valentin Tokyo/Japan -Translation: Hi Bioern, es ist bessser alle anfragen an die mailing Liste grundsaetzlich in English zu formulieren. Besten Gruss Nils Valentin Tokyo/Japan 2003 7 7 16:37Bjrn Weichel : Hallo lieber Leser, Ich versuche seit lngerem mit dem u. g. Befehl eine .csv Tabelle in eine Datenbank einzupflegen. Auf dem Server luft MySQL 3.23.5* und der Import funktioniert nicht. Der andere Server hat die MySQL Version 3.23.44 und der Import funktioniert. Ich habe die Rechte alle angeschaltet, so dass es auch da keine Probleme geben sollte. Hier mein Befehl: LOAD DATA LOCAL INFILE 'csv/gversand.csv' REPLACE INTO TABLE versand FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\' Vielen Dank fr die Hilfe. Gru Bjrn +++ Media2be, Weichel Mller GbR Agentur fr Neue Medien, Marketing und Handel St. Johanner Str. 41-43 66111 Saarbrcken Fon: 0681 59 59 08 98 Fax: 0681 59 59 08 99 Mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Net: http://www.media2be.de http://www.media2be.de +++ -- --- Valentin Nils Internet Technology E-Mail: [EMAIL PROTECTED] URL: http://www.knowd.co.jp Personal URL: http://www.knowd.co.jp/staff/nils -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Load Data Local Infile
OK, tearing my hair out here... I am trying to get a LOAD DATA LOCAL INFILE command to work. It works when I start the MySQL client with --local-infile=1, but never in any other situation. Starting without this option, or submitting the request through PHP or Lasso results in the command isn't supported error. I have tried a million different my.cnf changes, but no luck. Is there any way to tell MySQL to default to allowing LOAD DATA LOCAL INFILE instead of having to specify it in the client login? I'm trying this with both version 3.23.51 and 4.0.12-max. The even odder thing is that I can get it to work fine on another machine running the pre-built 3.23.51 binary from entropy.ch. AND, if I move that build to the 3.23.51 hand-built machine, the error returns. Any ideas GREATLY appreciated. Thanks! - John -- --- John May : President http://www.pointinspace.com Point In Space Internet Solutions [EMAIL PROTECTED] LPA Corporate Partner / FSA Associate / ACN Member Lasso 5 + 6 / PHP / MySQL / FileMaker Pro Hosting Now Available! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile
If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients, unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0) in the client Read the mysql manual from msyql.com about 'manual_MySQL_Database_Administration.html#LOAD_DATA_LOCAL' Regards, - Original Message - From: John May [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 2:17 AM Subject: Load Data Local Infile OK, tearing my hair out here... I am trying to get a LOAD DATA LOCAL INFILE command to work. It works when I start the MySQL client with --local-infile=1, but never in any other situation. Starting without this option, or submitting the request through PHP or Lasso results in the command isn't supported error. I have tried a million different my.cnf changes, but no luck. Is there any way to tell MySQL to default to allowing LOAD DATA LOCAL INFILE instead of having to specify it in the client login? I'm trying this with both version 3.23.51 and 4.0.12-max. The even odder thing is that I can get it to work fine on another machine running the pre-built 3.23.51 binary from entropy.ch. AND, if I move that build to the 3.23.51 hand-built machine, the error returns. Any ideas GREATLY appreciated. Thanks! - John -- --- John May : President http://www.pointinspace.com Point In Space Internet Solutions [EMAIL PROTECTED] LPA Corporate Partner / FSA Associate / ACN Member Lasso 5 + 6 / PHP / MySQL / FileMaker Pro Hosting Now Available! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile
Can this only be done at build time? Or can I enable it after the fact? If so, how? I tried enable-local-infile as both a setting in my.cnf and when calling safe_mysqld both with no luck. In the meantime, I've found that PHP apparently calls MySQL with the local-infile option on - once I downgraded to 4.2.2 from 4.3.0 that is. This at least helps things a bit. - John If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients, unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0) in the client Read the mysql manual from msyql.com about 'manual_MySQL_Database_Administration.html#LOAD_DATA_LOCAL' Regards, - Original Message - From: John May [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 2:17 AM Subject: Load Data Local Infile OK, tearing my hair out here... I am trying to get a LOAD DATA LOCAL INFILE command to work. It works when I start the MySQL client with --local-infile=1, but never in any other situation. Starting without this option, or submitting the request through PHP or Lasso results in the command isn't supported error. I have tried a million different my.cnf changes, but no luck. Is there any way to tell MySQL to default to allowing LOAD DATA LOCAL INFILE instead of having to specify it in the client login? I'm trying this with both version 3.23.51 and 4.0.12-max. The even odder thing is that I can get it to work fine on another machine running the pre-built 3.23.51 binary from entropy.ch. AND, if I move that build to the 3.23.51 hand-built machine, the error returns. Any ideas GREATLY appreciated. Thanks! - John -- --- John May : President http://www.pointinspace.com Point In Space Internet Solutions [EMAIL PROTECTED] LPA Corporate Partner / FSA Associate / ACN Member Lasso 5 + 6 / PHP / MySQL / FileMaker Pro Hosting Now Available! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile
The other odd thing I find is that the MySQL manual states: By default, all MySQL clients and libraries are compiled with --enable-local-infile , to be compatible with MySQL 3.23.48 and before. However, I'm using a 4.0.12-max binary (pre-compiled binary direct from MySQL's site) on one machine, and enable-local-infile is definitely NOT compiled into it... Have others seen this case contrary to the documentation? - John Can this only be done at build time? Or can I enable it after the fact? If so, how? I tried enable-local-infile as both a setting in my.cnf and when calling safe_mysqld both with no luck. In the meantime, I've found that PHP apparently calls MySQL with the local-infile option on - once I downgraded to 4.2.2 from 4.3.0 that is. This at least helps things a bit. - John If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients, unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0) in the client Read the mysql manual from msyql.com about 'manual_MySQL_Database_Administration.html#LOAD_DATA_LOCAL' Regards, - Original Message - From: John May [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 2:17 AM Subject: Load Data Local Infile OK, tearing my hair out here... I am trying to get a LOAD DATA LOCAL INFILE command to work. It works when I start the MySQL client with --local-infile=1, but never in any other situation. Starting without this option, or submitting the request through PHP or Lasso results in the command isn't supported error. I have tried a million different my.cnf changes, but no luck. Is there any way to tell MySQL to default to allowing LOAD DATA LOCAL INFILE instead of having to specify it in the client login? I'm trying this with both version 3.23.51 and 4.0.12-max. The even odder thing is that I can get it to work fine on another machine running the pre-built 3.23.51 binary from entropy.ch. AND, if I move that build to the 3.23.51 hand-built machine, the error returns. Any ideas GREATLY appreciated. Thanks! - John -- --- John May : President http://www.pointinspace.com Point In Space Internet Solutions [EMAIL PROTECTED] LPA Corporate Partner / FSA Associate / ACN Member Lasso 5 + 6 / PHP / MySQL / FileMaker Pro Hosting Now Available! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John May wrote: The other odd thing I find is that the MySQL manual states: By default, all MySQL clients and libraries are compiled with --enable-local-infile , to be compatible with MySQL 3.23.48 and before. However, I'm using a 4.0.12-max binary (pre-compiled binary direct from MySQL's site) on one machine, and enable-local-infile is definitely NOT compiled into it... Have others seen this case contrary to the documentation? - John You don't say what OS you're on, but this was broken in Windows builds until MySQL 4.0.13 (which is the latest stable version, btw.) -Mark - -- For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, SW Dev. Manager - J2EE/Windows /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+46F7tvXNTca6JD8RAqwZAJwNVmxY0KhQXm5NXpcAyiSTFKRp6gCfVwnj UAMdENoo/r4wH8izEQwTYrU= =g6z4 -END PGP SIGNATURE- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile
configuring is only be done on build time procedure. I supposed (not sure) that your problem is with your precompiled binary. I dont really know whether the default precompiled binary building with enable LOAD DATA or not. so , you can try install it with mysql source .(not precompile binary). Regards. ROny - Original Message - From: John May [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 3:31 AM Subject: Re: Load Data Local Infile The other odd thing I find is that the MySQL manual states: By default, all MySQL clients and libraries are compiled with --enable-local-infile , to be compatible with MySQL 3.23.48 and before. However, I'm using a 4.0.12-max binary (pre-compiled binary direct from MySQL's site) on one machine, and enable-local-infile is definitely NOT compiled into it... Have others seen this case contrary to the documentation? - John Can this only be done at build time? Or can I enable it after the fact? If so, how? I tried enable-local-infile as both a setting in my.cnf and when calling safe_mysqld both with no luck. In the meantime, I've found that PHP apparently calls MySQL with the local-infile option on - once I downgraded to 4.2.2 from 4.3.0 that is. This at least helps things a bit. - John If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients, unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0) in the client Read the mysql manual from msyql.com about 'manual_MySQL_Database_Administration.html#LOAD_DATA_LOCAL' Regards, - Original Message - From: John May [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 09, 2003 2:17 AM Subject: Load Data Local Infile OK, tearing my hair out here... I am trying to get a LOAD DATA LOCAL INFILE command to work. It works when I start the MySQL client with --local-infile=1, but never in any other situation. Starting without this option, or submitting the request through PHP or Lasso results in the command isn't supported error. I have tried a million different my.cnf changes, but no luck. Is there any way to tell MySQL to default to allowing LOAD DATA LOCAL INFILE instead of having to specify it in the client login? I'm trying this with both version 3.23.51 and 4.0.12-max. The even odder thing is that I can get it to work fine on another machine running the pre-built 3.23.51 binary from entropy.ch. AND, if I move that build to the 3.23.51 hand-built machine, the error returns. Any ideas GREATLY appreciated. Thanks! - John -- --- John May : President http://www.pointinspace.com Point In Space Internet Solutions [EMAIL PROTECTED] LPA Corporate Partner / FSA Associate / ACN Member Lasso 5 + 6 / PHP / MySQL / FileMaker Pro Hosting Now Available! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile
OS X (10.1 Client and 10.2 Server). My 3.23.51 builds seem to have the same problem. Since PHP access it properly, and the MySQL client can with the proper variable setting, I guess I'll just leave it alone. - John -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John May wrote: The other odd thing I find is that the MySQL manual states: By default, all MySQL clients and libraries are compiled with --enable-local-infile , to be compatible with MySQL 3.23.48 and before. However, I'm using a 4.0.12-max binary (pre-compiled binary direct from MySQL's site) on one machine, and enable-local-infile is definitely NOT compiled into it... Have others seen this case contrary to the documentation? - John You don't say what OS you're on, but this was broken in Windows builds until MySQL 4.0.13 (which is the latest stable version, btw.) -Mark - -- For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, SW Dev. Manager - J2EE/Windows /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+46F7tvXNTca6JD8RAqwZAJwNVmxY0KhQXm5NXpcAyiSTFKRp6gCfVwnj UAMdENoo/r4wH8izEQwTYrU= =g6z4 -END PGP SIGNATURE- -- --- John May : President http://www.pointinspace.com Point In Space Internet Solutions [EMAIL PROTECTED] LPA Corporate Partner / FSA Associate / ACN Member Lasso 5 + 6 / PHP / MySQL / FileMaker Pro Hosting Now Available! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: FW: RE: About LOAD DATA LOCAL INFILE - Still not working
Vahri? MUHTARYAN [EMAIL PROTECTED] wrote: I commented out because they are not working when I use set-variable = local-infile=1 in Server and Client .. Mysql is not starting ?f I use local-infile=1 -- Mysql is starting but still same problem ... I used --local-infile=1 at command line but still same problem -- This version is not ... It worked perfect for me. Do you use command-line client program mysql or any other? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
re: Bug-Load data local infile
On Wednesday 19 February 2003 17:30, Guddack Thorsten ICM MP SCM GO 21 wrote: I'm using 4.0.10-max-nt of mysql. I update to this version from 4.0.5. With this version I have no trouble with load data local infile. But now if i try to use it from the mysql-Command-line tool i get an errror 1148, This command is not allowed with this mysql version. On my server the variable local_infile is set to on. I change to my.cnf-File on my client to [mysql] local-infile=1 or I try to start mysql with the option --local-infile. Everything gives me the same error. Any Ideas? You should set this variable for the server, too. [mysqld] local-infile=1 -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Bug-Load data local infile
Hi, yes I did this . here were some lines from my server-cfg file: [mysqld] port=3306 #socket=MySQL skip-locking set-variable= key_buffer=16M set-variable= max_allowed_packet=1M set-variable= table_cache=64 set-variable= sort_buffer=512K set-variable= net_buffer_length=8K set-variable= myisam_sort_buffer_size=8M server-id = 1 skip-name-resolve local-infile=1 Also if I ask the server with 'Show variables like 'loc%'' he says me loc_infile=ON So what's going wrong. Best regards -Original Message- From: Egor Egorov [SMTP:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 1:07 PM To: [EMAIL PROTECTED] Subject: re: Bug-Load data local infile On Wednesday 19 February 2003 17:30, Guddack Thorsten ICM MP SCM GO 21 wrote: I'm using 4.0.10-max-nt of mysql. I update to this version from 4.0.5. With this version I have no trouble with load data local infile. But now if i try to use it from the mysql-Command-line tool i get an errror 1148, This command is not allowed with this mysql version. On my server the variable local_infile is set to on. I change to my.cnf-File on my client to [mysql] local-infile=1 or I try to start mysql with the option --local-infile. Everything gives me the same error. Any Ideas? You should set this variable for the server, too. [mysqld] local-infile=1 -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re[2]: Bug-Load data local infile
Egor, But now if i try to use it from the mysql-Command-line tool i get an errror 1148, This command is not allowed with this mysql version. On my server the variable local_infile is set to on. I change to my.cnf-File on my client to [mysql] local-infile=1 or I try to start mysql with the option --local-infile. Everything gives me the same error. You should set this variable for the server, too. [mysqld] local-infile=1 When I start the server with --local-infile=1 (actually, it's in my my.ini as you described), and I start the client with the same option, I get this: C:\mysql\binmysql test --local-infile=1 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 to server version: 4.0.10-gamma-max-nt-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql load data local infile 'c:/test.txt' into table umlaut; ERROR 1148: The used command is not allowed with this MySQL version mysql SHOW VARIABLES LIKE 'local%'; +---+---+ | Variable_name | Value | +---+---+ | local_infile | ON| +---+---+ This is not the documented behaviour. So is it a bug? Regards, -- Stefan Hinz [EMAIL PROTECTED] iConnect GmbH http://iConnect.de Heesestr. 6, 12169 Berlin (Germany) Telefon: +49 30 7970948-0 Fax: +49 30 7970948-3 [filter fodder: sql, mysql, query] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Bug-Load data local infile
Hi List, I'm using 4.0.10-max-nt of mysql. I update to this version from 4.0.5. With this version I have no trouble with load data local infile. But now if i try to use it from the mysql-Command-line tool i get an errror 1148, This command is not allowed with this mysql version. On my server the variable local_infile is set to on. I change to my.cnf-File on my client to [mysql] local-infile=1 or I try to start mysql with the option --local-infile. Everything gives me the same error. Any Ideas? Thorsten Guddack - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE :
HI, Thanks all for the suggestions given for load data... It indeed helped me a lot. Right now i am using J/connector version 3 . Load data local works fine with version 3. I hit a new problem. It works fine when there are below 2 records in the file. When i tried wiht 4,00,000 records inthe file it gave an exception. packet for query is too large (5242884 5241856) com.mysql.jdbc.Packettoobigexception Any thoughts on this. Anis - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE :
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ahmed S K Anis wrote: HI, Thanks all for the suggestions given for load data... It indeed helped me a lot. Right now i am using J/connector version 3 . Load data local works fine with version 3. I hit a new problem. It works fine when there are below 2 records in the file. When i tried wiht 4,00,000 records inthe file it gave an exception. packet for query is too large (5242884 5241856) com.mysql.jdbc.Packettoobigexception Any thoughts on this. Anis You need to set the max_allowed_packet configuration variable for your MySQL server large enough to handle the largest file you want to send as a single packet. If you are sending large files, you will most likely want to use MySQL-4.0 or newer as well, as the protocol in MySQL-4.0 handles larger packets than MySQL-3.23 does. -Mark - -- MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+S6UytvXNTca6JD8RAk14AJ4xXGKDunjkHXnfZLOHJtPJfucK1wCdFEZ/ yTQL8+T/K5ce4pHXLtgx1is= =ihg1 -END PGP SIGNATURE- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
JDBC and LOAD DATA LOCAL INFILE : The used command is not allowed with this MySQL version
Hello, I'm using this command into a Java servlet LOAD DATA LOCAL INFILE \ + FIC_DB + \ REPLACE INTO TABLE news; It runs well with mysql-3.23.45 but not with mysql-3.23.55 The error message is : java.sql.SQLException: General error: The used command is not allowed with this MySQL version at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550) at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815) at org.gjt.mm.mysql.Statement.executeQuery(Statement.java:169) at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78) ... I compiled mysql-3.23.55 with the option --enable-local-infile and runs it with the argument! --local-i nfile=1. If I use the mysql client, it runs but not inside my Java servlet. Could you help me to find a solution ? Thank you Cédric. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE : The used command is notallowed with this MySQL version
Hi all, please let me now if there is a solution to this. I am facing the same problem. Anis [EMAIL PROTECTED] [EMAIL PROTECTED] Wednesday, February 12, 2003 3:48:16 PM Hello, I'm using this command into a Java servlet LOAD DATA LOCAL INFILE \ + FIC_DB + \ REPLACE INTO TABLE news; It runs well with mysql-3.23.45 but not with mysql-3.23.55 The error message is : java.sql.SQLException: General error: The used command is not allowed with this MySQL version at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550) at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815) at org.gjt.mm.mysql.Statement.executeQuery(Statement.java:169) at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78) ... I compiled mysql-3.23.55 with the option --enable-local-infile and runs it with the argument! --local-i nfile=1. If I use the mysql client, it runs but not inside my Java servlet. Could you help me to find a solution ? Thank you Cédric. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE : The used command is not allowedwith this MySQL version
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ahmed S K Anis wrote: Hi all, please let me now if there is a solution to this. I am facing the same problem. Anis [EMAIL PROTECTED] [EMAIL PROTECTED] Wednesday, February 12, 2003 3:48:16 PM Hello, I'm using this command into a Java servlet LOAD DATA LOCAL INFILE \ + FIC_DB + \ REPLACE INTO TABLE news; It runs well with mysql-3.23.45 but not with mysql-3.23.55 The error message is : java.sql.SQLException: General error: The used command is not allowed with this MySQL version at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550) at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882) at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815) at org.gjt.mm.mysql.Statement.executeQuery(Statement.java:169) at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78) ... I compiled mysql-3.23.55 with the option --enable-local-infile and runs it with the argument! --local-i nfile=1. If I use the mysql client, it runs but not inside my Java servlet. Could you help me to find a solution ? You have to use the 3.0 Connector/J drivers for 'LOAD DATA LOCAL INFILE'. See http://www.mysql.com/products/connector-j/ The support for 'LOAD DATA LOCAL INFILE' appeared in 3.0, the latest version. It was never in MM.MySQL (which is what you're using, I assume something like 2.0.14), so I don't know how it was _ever_ working for you :) -Mark - -- MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+Sk2MtvXNTca6JD8RAkjDAKDHfJR6jCsHRrGq3yxK+LTCPzRbWQCfc0Ld RUnZYHgbelXstPKvO2qOj8U= =IvB1 -END PGP SIGNATURE- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE :
Thanks Mark, I tried to work with the latest driver. 3.0.4 Now it gave error shown below . Also see code snippet below at the end Error code is0 estoredata1.txt'for 'LOAD DATA LOCAL INFILE' command.Due to underlying IOExcepti on: ** BEGIN NESTED EXCEPTION ** java.io.FileNotFoundException estoredata1.txt (The system cannot find the file specified) STACKTRACE: estoredata1.txt (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:59) at com.mysql.jdbc.MysqlIO.sendFileToServer(MysqlIO.java:1505) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:964) at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:911) at com.mysql.jdbc.Connection.execSQL(Connection.java:1777) at com.mysql.jdbc.Connection.execSQL(Connection.java:1711) at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1293) at Sanity.Restore(Sanity.java:138) at Sanity.main(Sanity.java:70) CODE SNIPPET String filepath = sys:\\restore\\data1.txt; String query = load data local infile \' + filepath + \' into table trail; stmt.executeUpdate(query); what could be wrong here ? Anis - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE :
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ahmed S K Anis wrote: Thanks Mark, I tried to work with the latest driver. 3.0.4 Now it gave error shown below . Also see code snippet below at the end Error code is0 estoredata1.txt'for 'LOAD DATA LOCAL INFILE' command.Due to underlying IOExcepti on: ** BEGIN NESTED EXCEPTION ** java.io.FileNotFoundException estoredata1.txt (The system cannot find the file specified) STACKTRACE: estoredata1.txt (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:59) at com.mysql.jdbc.MysqlIO.sendFileToServer(MysqlIO.java:1505) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:964) at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:911) at com.mysql.jdbc.Connection.execSQL(Connection.java:1777) at com.mysql.jdbc.Connection.execSQL(Connection.java:1711) at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1293) at Sanity.Restore(Sanity.java:138) at Sanity.main(Sanity.java:70) CODE SNIPPET String filepath = sys:\\restore\\data1.txt; String query = load data local infile \' + filepath + \' into table trail; stmt.executeUpdate(query); what could be wrong here ? First, you do realize that 'load data local infile' means load the file that is on the client and send it to the server. Second, Java is saying it can't open the file 'estoredata1.txt', which either means it doesn't exist at the path you say it does, or the permissions are wrong. Can you load this same file using the MySQL command-line client using the _exact_ same path? -Mark - -- MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+Slf+tvXNTca6JD8RAq+YAJ0bV2N62jOE7UsCOL2aOH4A7Y2MnACgiQRw uLPb/oWgEJubdksxBafP6RU= =uzys -END PGP SIGNATURE- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE :
Yes Mark it worked from the command line. The Archived resides at the server side. I ran Load data local infile 'sys:\\mail\\dump.txt into table X it worked. The from a different machine i ran this java program. The Archived file still exists at the DB server side. So i guess local option is not necessary. It didnt work though I guess the path it takes is wrong. String filepath = sys:\\restore\\data1.txt; String query = load data local infile \' + filepath + \' into table x it takes as estoredata1.txt as file name not clear why ? Like to add here that Select * into outfile works perfect from JDBC wiht same filepath Mark Matthews [EMAIL PROTECTED] Wednesday, February 12, 2003 7:49:42 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ahmed S K Anis wrote: Thanks Mark, I tried to work with the latest driver. 3.0.4 Now it gave error shown below . Also see code snippet below at the end Error code is0 estoredata1.txt'for 'LOAD DATA LOCAL INFILE' command.Due to underlying IOExcepti on: ** BEGIN NESTED EXCEPTION ** java.io.FileNotFoundException estoredata1.txt (The system cannot find the file specified) STACKTRACE: estoredata1.txt (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:59) at com.mysql.jdbc.MysqlIO.sendFileToServer(MysqlIO.java:1505) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:964) at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:911) at com.mysql.jdbc.Connection.execSQL(Connection.java:1777) at com.mysql.jdbc.Connection.execSQL(Connection.java:1711) at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1293) at Sanity.Restore(Sanity.java:138) at Sanity.main(Sanity.java:70) CODE SNIPPET String filepath = sys:\\restore\\data1.txt; String query = load data local infile \' + filepath + \' into table trail; stmt.executeUpdate(query); what could be wrong here ? First, you do realize that 'load data local infile' means load the file that is on the client and send it to the server. Second, Java is saying it can't open the file 'estoredata1.txt', which either means it doesn't exist at the path you say it does, or the permissions are wrong. Can you load this same file using the MySQL command-line client using the _exact_ same path? -Mark - -- MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+Slf+tvXNTca6JD8RAq+YAJ0bV2N62jOE7UsCOL2aOH4A7Y2MnACgiQRw uLPb/oWgEJubdksxBafP6RU= =uzys -END PGP SIGNATURE- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE :
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ahmed S K Anis wrote: Yes Mark it worked from the command line. The Archived resides at the server side. I ran Load data local infile 'sys:\\mail\\dump.txt into table X it worked. The from a different machine i ran this java program. The Archived file still exists at the DB server side. So i guess local option is not necessary. It didnt work though I guess the path it takes is wrong. String filepath = sys:\\restore\\data1.txt; String query = load data local infile \' + filepath + \' into table x it takes as estoredata1.txt as file name not clear why ? Because '\\' in Java is the escape code for a _single '\' :) You need to get \\ in String literals. What your String actually ends up being is sys:\restore\data1.txt, and '\' also has special meaning in MySQL. -Mark - -- MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+Sl0btvXNTca6JD8RAmptAKCqDXC/l8YnSqemI5YbHVhlaC187wCfVzRG OPROaY07+yKvKHHjuwy7uEU= =V70Y -END PGP SIGNATURE- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC and LOAD DATA LOCAL INFILE :
* Ahmed S K Anis [...] String filepath = sys:\\restore\\data1.txt; String query = load data local infile \' + filepath + \' into table x it takes as estoredata1.txt as file name not clear why ? A double backslash will in many environments be reduced to a single backslash. Your result indicate that you are in such an environment (VBA?), as mysql only sees single backslashes: mysql select sys:\restore\data1.txt; +--+ estoredata1.txt | +--+ estoredata1.txt | +--+ 1 row in set (0.00 sec) Try to double your backslashes twice: String filepath = sys:restoredata1.txt Your programming environment will remove every other backslash, so that mysql sees this: mysql select sys:\\restore\\data1.txt; ++ | sys:\restore\data1.txt | ++ | sys:\restore\data1.txt | ++ 1 row in set (0.00 sec) -- Roger - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data local infile
Terence, Rich, I have tried: LOAD DATA LOCAL INFILE lcopen1.txt INTO TABLE lcopen; but it shows: ERROR 1148: The used command is not allowed with this MySQL version This is because of security issues, as the manual says: In MySQL 3.23.49 and MySQL 4.0.2, we added some new options to deal with possible security issues when it comes to LOAD DATA LOCAL. [snip] If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients, unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0) in the client. [snip] For the mysql command-line client, LOAD DATA LOCAL can be enabled by specifying the option -- local-infile[=1], or disabled with --local-infile=0. Full text: http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html I use 4.0.7-max-nt on a Win2K box, and whatever I do, I cannot use LOAD DATA LOCAL (keep getting error 1148). I tried: - Starting the server with --local-infile=1, and once more with --local-infile. - Starting the mysql client with --local-infile[=1] - Combining server and client options The manual page on this is quite contradictory. I agree with the user comment on that manual page: I just wasted 3 hours of my time tracking down this annoying security improvement -- thanks but no thanks, MySQL developers. This was poorly thought out and poorly implemented. Any hints how to make LOAD DATA LOCAL work? Regards, -- Stefan Hinz [EMAIL PROTECTED] Geschäftsführer / CEO iConnect GmbH http://iConnect.de Heesestr. 6, 12169 Berlin (Germany) Tel: +49 30 7970948-0 Fax: +49 30 7970948-3 - Original Message - From: rich allen [EMAIL PROTECTED] To: Terence Ng [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 01, 2003 6:23 AM Subject: Re: load data local infile sound like you may want to add the following to your my.cnf file for MySQL [mysqld] local-infile=1 [mysql] local-infile=1 - hcir On Tuesday, December 31, 2002, at 06:23 PM, Terence Ng wrote: Hi, I have just upgraded to 3.23.54 How to input bulk data into table? I have tried: LOAD DATA LOCAL INFILE lcopen1.txt INTO TABLE lcopen; but it shows: ERROR 1148: The used command is not allowed with this MySQL version How come? What method can I use to input bulk data? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
load data local infile
Hi, I have just upgraded to 3.23.54 How to input bulk data into table? I have tried: LOAD DATA LOCAL INFILE lcopen1.txt INTO TABLE lcopen; but it shows: ERROR 1148: The used command is not allowed with this MySQL version What did I miss? What method can I use to input bulk data? Terence Ng _ Lonely Christmas(³¯«³¨³)¡A·ºå»P·(Twins)¡AµL¶¡¹D(¹q¼v)... ¦ÜIn¤â¾÷¹aÁn ³§A¹L¥V¤Ñ http://ringtone.yahoo.com.hk - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
load data local infile
Hi, I have just upgraded to 3.23.54 How to input bulk data into table? I have tried: LOAD DATA LOCAL INFILE lcopen1.txt INTO TABLE lcopen; but it shows: ERROR 1148: The used command is not allowed with this MySQL version How come? What method can I use to input bulk data? Terence Ng _ Lonely Christmas(³¯«³¨³)¡A·ºå»P·(Twins)¡AµL¶¡¹D(¹q¼v)... ¦ÜIn¤â¾÷¹aÁn ³§A¹L¥V¤Ñ http://ringtone.yahoo.com.hk - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data local infile
sound like you may want to add the following to your my.cnf file for MySQL [mysqld] local-infile=1 [mysql] local-infile=1 - hcir On Tuesday, December 31, 2002, at 06:23 PM, Terence Ng wrote: Hi, I have just upgraded to 3.23.54 How to input bulk data into table? I have tried: LOAD DATA LOCAL INFILE lcopen1.txt INTO TABLE lcopen; but it shows: ERROR 1148: The used command is not allowed with this MySQL version How come? What method can I use to input bulk data? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Load Data Local Infile
Thanks for the suggestions. So far I haven't been able to get this to work except on the client command line. I'm trying to use some PHP scripts with mysql_connect() and have added MYSQL_OPT_LOCAL_INFILE to the connection script as well, but no go. I added [client} local-infile=1 [mysql] local-infile=1 [mysqld] local-infile=1 to the my.cnf file but that still hasn't done it. Could it be that recompiling with --enable-local-infile is the only way to get this to work? Does anyone have any other suggestions? Thanks very much Jon Bertsch - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
load data local infile
Hi: I am using mysql v4_0_5 both clinet and server. I cannot get load data local infile to work after many different tries. Does anyone make it work with this version? It worked for when I used v3.23.52. Thanks for any tips, Yuyi - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data local infile
try adding these line to your my.cnf file (mysql config file) [mysqld] local-infile=1 [mysql] local-infile=1 - hcir On Thursday, December 12, 2002, at 09:52 AM, Yuyi Guo wrote: Hi: I am using mysql v4_0_5 both clinet and server. I cannot get load data local infile to work after many different tries. Does anyone make it work with this version? It worked for when I used v3.23.52. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data local infile
Thanks, it works after we recomplied it the enable-local-infile. By default, it is truned off. Cheers, yuyi Rich Allen wrote: try adding these line to your my.cnf file (mysql config file) [mysqld] local-infile=1 [mysql] local-infile=1 - hcir On Thursday, December 12, 2002, at 09:52 AM, Yuyi Guo wrote: Hi: I am using mysql v4_0_5 both clinet and server. I cannot get load data local infile to work after many different tries. Does anyone make it work with this version? It worked for when I used v3.23.52. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
load data LOCAL infile to upload to a remote database
Hi. I have a MySQL database running on a remote web server. I have a text data file sitting on my PC here. I want to get the data from the text file to the database and am having difficulties! I log onto the database and I'd like to issue LOAD DATA LOCAL INFILE c:/thedata.txt INTO TABLE thetable ..and be done with it, but I get an error 13: can't find file (or can't get stat of file) message. can anyone help? The manual pages on mysql.com didn't help me. cheers. rich - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA LOCAL INFILE mysqld-nt.exe --local-infile=1 does not work for win32
Hi, When trying to use 'LOAD DATA LOCAL INFILE' with Apache2.0.43 (running a module) and MySQL 3.23.53, it returns the error the command is not supported. This is because the function is disable for security issue, but when I tried to start mysql with 'c:\mysql\bin\mysqld-nt --local-infile=1' it still does not work. In my scriptI have the following line: $resultImport = mysql_db_query($sql_db,LOAD DATA LOCAL INFILE '$myfilename' INTO TABLE $mytablename FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '' LINES TERMINATED BY '\r\n') or die (mysql_error()); When run I get this error: The used command is not allowed with this MySQL version. If I run mysql from mysql client command prompt, I get application error pop-up dialog with the following message: mysqld-nt.exe-Application Error The instruction at 0x0044dcd0 referenced memory at 0x000. The memory could not be read. In the command prompt I have the following message: mysql load data infile import.txt into table testdb.t1; ERROR 2006: MySQL server has gone away No connection. Trying to reconnect... Connection id:3 Current database: *** NONE *** ERROR 2013: Lost connection to MySQL server during query Does anyone have any idea on how to enable LOAD DATA LOCAL INFILE globally with MySQL 3.23.53 and Apache 2.0.43 (running as module)? If I use Apache 1.3.27, I do not have this problem. The link http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html is not very helpful; Does not provide information to enable Load Data Local Infile globally for win32. Could someone please help. Thanks. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: LOAD DATA LOCAL INFILE
John, Thursday, November 28, 2002, 7:02:58 PM, you wrote: JC Thanks very much. JC Following on your suggestions, I then went ahead and put the text file JC into my directory: JC /usr/local/mysql JC so that the file was then /usr/local/mysql/absence.txt JC and, with that done, the JC LOAD DATA LOCAL INFILE absence.txt into table absence; JC command in the mysql client successfully did load it. JC (It didn't work when put into the /usr/local/mysql/scripts directory JC or in the /usr/local/mysql/data directory.) JC Is there anyway to change the place where the client looks when given JC the relative pathname of a file to be LOADed, or is one stuck with JC having to put all text files in that one immutable location? Nope. And storing text files in /usr/local/mysql is not a good idea .. If you execute LOAD DATA LOCAL from your own client application/script, store path to the dir in some configuration variable and so on. JC (On the Mac, we aren't allowed to see the contents of JC /usr/local/mysql/ in the GUI. We have to access it through the UNIX JC Terminal program, and then fiddle with permissions, which, I am not JC bashful to say, I am reluctant to start doing without comprehending the JC implications, which, I also am not bashful to say, I don't.) -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA LOCAL INFILE
Hello all --- I posted this yesterday, perhaps before my subscription took effect, and so I am not sure that it got distributed. So, forgive the repetition in sending, if that's the case. Anyway . . . Here's the question, as succinctly as I can formulate it: The documentation seems to say that one can load a tab-delimited text file located in the current directory of the client host into a database by running the client mysql and executing the following command: mysql LOAD DATA LOCAL INFILE absence.txt into table absence; When absence.txt is located in /Users/jack/Desktop/SQL_stuff/samp_db/, then the command: mysql LOAD DATA LOCAL INFILE /Users/jack/Desktop/SQL_stuff/samp_db/ absence.txt into table absence; does work. But the command: mysql LOAD DATA LOCAL INFILE absence.txt into table absence; does not work. Rather, it produces the error: ERROR: File 'absence.txt' not found (Errcode: 2) That is, absolute pathnames work, but relative pathnames do not. I have been careful to be sure that, when invoking the mysql client, I am in the correct directory, and that when I invoke mysql, that I include the --local-infile option, as the following printout shows: [Jacks-G4:~/Desktop/SQL_stuff/samp_db] jack% mysql --local-infile samp_db Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 to server version: 3.23.52-entropy.ch Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql LOAD DATA LOCAL INFILE absence.txt into table absence; ERROR: File 'absence.txt' not found (Errcode: 2) I have concluded that one cannot use the relative pathname of a file in the LOAD DATA LOCAL INFILE command. I hope I am wrong, as it would be nice to use the simpler, relative, pathname. With thanks for your replies, am I wrong or right? If wrong, what am I missing? Jack Connolly Hanover, MA [EMAIL PROTECTED] Running, on Mac OS 10.2, server and client on same machine: ++ | version() | ++ | 3.23.52-entropy.ch | ++ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: LOAD DATA LOCAL INFILE
The MySQL Manual states the following in the LOAD DATA INFILE section :- If a filename with no leading components is given, the server looks for the file in the database directory of the current database. -Original Message- From: John Connolly [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 14:12 To: [EMAIL PROTECTED] Subject: LOAD DATA LOCAL INFILE Hello all --- I posted this yesterday, perhaps before my subscription took effect, and so I am not sure that it got distributed. So, forgive the repetition in sending, if that's the case. Anyway . . . Here's the question, as succinctly as I can formulate it: The documentation seems to say that one can load a tab-delimited text file located in the current directory of the client host into a database by running the client mysql and executing the following command: mysql LOAD DATA LOCAL INFILE absence.txt into table absence; When absence.txt is located in /Users/jack/Desktop/SQL_stuff/samp_db/, then the command: mysql LOAD DATA LOCAL INFILE /Users/jack/Desktop/SQL_stuff/samp_db/ absence.txt into table absence; does work. But the command: mysql LOAD DATA LOCAL INFILE absence.txt into table absence; does not work. Rather, it produces the error: ERROR: File 'absence.txt' not found (Errcode: 2) That is, absolute pathnames work, but relative pathnames do not. I have been careful to be sure that, when invoking the mysql client, I am in the correct directory, and that when I invoke mysql, that I include the --local-infile option, as the following printout shows: [Jacks-G4:~/Desktop/SQL_stuff/samp_db] jack% mysql --local-infile samp_db Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 to server version: 3.23.52-entropy.ch Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql LOAD DATA LOCAL INFILE absence.txt into table absence; ERROR: File 'absence.txt' not found (Errcode: 2) I have concluded that one cannot use the relative pathname of a file in the LOAD DATA LOCAL INFILE command. I hope I am wrong, as it would be nice to use the simpler, relative, pathname. With thanks for your replies, am I wrong or right? If wrong, what am I missing? Jack Connolly Hanover, MA [EMAIL PROTECTED] Running, on Mac OS 10.2, server and client on same machine: ++ | version() | ++ | 3.23.52-entropy.ch | ++ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php BBCi at http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system, do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: LOAD DATA LOCAL INFILE
John, Thursday, November 28, 2002, 2:12:27 AM, you wrote: JC Here's the question, as succinctly as I can formulate it: JC The documentation seems to say that one can load a tab-delimited text JC file located in the current directory of the client host into a JC database by running the client mysql and executing the following JC command: JC mysql LOAD DATA LOCAL INFILE absence.txt into table absence; JC When absence.txt is located in JC /Users/jack/Desktop/SQL_stuff/samp_db/, then the command: JC mysql LOAD DATA LOCAL INFILE /Users/jack/Desktop/SQL_stuff/samp_db/ JC absence.txt into table absence; JC does work. JC But the command: JC mysql LOAD DATA LOCAL INFILE absence.txt into table absence; JC does not work. Rather, it produces the error: JC ERROR: JC File 'absence.txt' not found (Errcode: 2) JC That is, absolute pathnames work, but relative pathnames do not. JC I have been careful to be sure that, when invoking the mysql client, I JC am in the correct directory, and that when I invoke mysql, that I JC include the --local-infile option, as the following printout shows: JC [Jacks-G4:~/Desktop/SQL_stuff/samp_db] jack% mysql --local-infile JC samp_db JC Reading table information for completion of table and column names JC You can turn off this feature to get a quicker startup with -A JC Welcome to the MySQL monitor. Commands end with ; or \g. JC Your MySQL connection id is 14 to server version: 3.23.52-entropy.ch JC Type 'help;' or '\h' for help. Type '\c' to clear the buffer. JC mysql LOAD DATA LOCAL INFILE absence.txt into table absence; JC ERROR: JC File 'absence.txt' not found (Errcode: 2) JC I have concluded that one cannot use the relative pathname of a file JC in the LOAD DATA LOCAL INFILE command. I hope I am wrong, as it would JC be nice to use the simpler, relative, pathname. JC Am I wrong or right? If wrong, what am I missing? If you don't use absolute pathname, your file must be located in the client program/script directory (in your case mysql client program) -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA LOCAL INFILE
Victoria and Michael: Thanks very much. Following on your suggestions, I then went ahead and put the text file into my directory: /usr/local/mysql so that the file was then /usr/local/mysql/absence.txt and, with that done, the LOAD DATA LOCAL INFILE absence.txt into table absence; command in the mysql client successfully did load it. (It didn't work when put into the /usr/local/mysql/scripts directory or in the /usr/local/mysql/data directory.) Is there anyway to change the place where the client looks when given the relative pathname of a file to be LOADed, or is one stuck with having to put all text files in that one immutable location? (On the Mac, we aren't allowed to see the contents of /usr/local/mysql/ in the GUI. We have to access it through the UNIX Terminal program, and then fiddle with permissions, which, I am not bashful to say, I am reluctant to start doing without comprehending the implications, which, I also am not bashful to say, I don't.) Thanks again. Best, Jack Connolly Hanover, MA P.S. -- Is this how I am supposed to reply to responses, i.e., by directing them back to the list, as opposed to the individual? Thnx, J. On Thursday, November 28, 2002, at 09:23 AM, Michael Ryan wrote: The MySQL Manual states the following in the LOAD DATA INFILE section :- If a filename with no leading components is given, the server looks for the file in the database directory of the current database. On Thursday, November 28, 2002, at 10:42 AM, Victoria Reznichenko wrote: John, Thursday, November 28, 2002, 2:12:27 AM, you wrote: JC Here's the question, as succinctly as I can formulate it: JC The documentation seems to say that one can load a tab-delimited text JC file located in the current directory of the client host into a JC database by running the client mysql and executing the following JC command: JC mysql LOAD DATA LOCAL INFILE absence.txt into table absence; JC When absence.txt is located in JC /Users/jack/Desktop/SQL_stuff/samp_db/, then the command: JC mysql LOAD DATA LOCAL INFILE /Users/jack/Desktop/SQL_stuff/samp_db/ JC absence.txt into table absence; JC does work. JC But the command: JC mysql LOAD DATA LOCAL INFILE absence.txt into table absence; JC does not work. Rather, it produces the error: JC ERROR: JC File 'absence.txt' not found (Errcode: 2) JC That is, absolute pathnames work, but relative pathnames do not. JC I have been careful to be sure that, when invoking the mysql client, I JC am in the correct directory, and that when I invoke mysql, that I JC include the --local-infile option, as the following printout shows: JC [Jacks-G4:~/Desktop/SQL_stuff/samp_db] jack% mysql --local-infile JC samp_db JC Reading table information for completion of table and column names JC You can turn off this feature to get a quicker startup with -A JC Welcome to the MySQL monitor. Commands end with ; or \g. JC Your MySQL connection id is 14 to server version: 3.23.52-entropy.ch JC Type 'help;' or '\h' for help. Type '\c' to clear the buffer. JC mysql LOAD DATA LOCAL INFILE absence.txt into table absence; JC ERROR: JC File 'absence.txt' not found (Errcode: 2) JC I have concluded that one cannot use the relative pathname of a file JC in the LOAD DATA LOCAL INFILE command. I hope I am wrong, as it would JC be nice to use the simpler, relative, pathname. JC Am I wrong or right? If wrong, what am I missing? If you don't use absolute pathname, your file must be located in the client program/script directory (in your case mysql client program) -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php
LOAD DATA LOCAL INFILE
Here's the question, as succinctly as I can formulate it: The documentation seems to say that one can load a tab-delimited text file located in the current directory of the client host into a database by running the client mysql and executing the following command: mysql LOAD DATA LOCAL INFILE absence.txt into table absence; When absence.txt is located in /Users/jack/Desktop/SQL_stuff/samp_db/, then the command: mysql LOAD DATA LOCAL INFILE /Users/jack/Desktop/SQL_stuff/samp_db/ absence.txt into table absence; does work. But the command: mysql LOAD DATA LOCAL INFILE absence.txt into table absence; does not work. Rather, it produces the error: ERROR: File 'absence.txt' not found (Errcode: 2) That is, absolute pathnames work, but relative pathnames do not. I have been careful to be sure that, when invoking the mysql client, I am in the correct directory, and that when I invoke mysql, that I include the --local-infile option, as the following printout shows: [Jacks-G4:~/Desktop/SQL_stuff/samp_db] jack% mysql --local-infile samp_db Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 to server version: 3.23.52-entropy.ch Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql LOAD DATA LOCAL INFILE absence.txt into table absence; ERROR: File 'absence.txt' not found (Errcode: 2) I have concluded that one cannot use the relative pathname of a file in the LOAD DATA LOCAL INFILE command. I hope I am wrong, as it would be nice to use the simpler, relative, pathname. Am I wrong or right? If wrong, what am I missing? Jack Connolly Hanover, MA [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
load data local infile
hello everybody, i m using redhat linux 7.2 with mysql 3.23.49a-max-log with Apache 1.3.24 . i have encounter following error for load data local infile when i tried to use an example on mysql site's documentation file : mysql use test; Database changed mysql show tables; ++ | Tables_in_test | ++ | dept | | emp| | person | | pet| | shirt | ++ 5 rows in set (0.00 sec) mysql desc pet; +-+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +-+-+--+-+-+---+ | name| varchar(20) | YES | | NULL| | | owner | varchar(20) | YES | | NULL| | | species | varchar(20) | YES | | NULL| | | sex | char(1) | YES | | NULL| | | birth | date| YES | | NULL| | | death | date| YES | | NULL| | +-+-+--+-+-+---+ 6 rows in set (0.00 sec) mysql LOAD DATA LOCAL INFILE pet.txt INTO TABLE pet; ERROR 1148: The used command is not allowed with this MySQL version mysql mysql select version(); +--+ | version()| +--+ | 3.23.49a-max-log | +--+ 1 row in set (0.00 sec) how do i go about it..if i want to load thousands of papers data data in text file? u'r response R most appreciated. pallavi - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data local infile
Hello Pallavi, i m using redhat linux 7.2 with mysql 3.23.49a-max-log with Apache 1.3.24 . i have encounter following error for load data local infile when i tried to use an example on mysql site's documentation file : mysql use test; Database changed mysql show tables; ++ | Tables_in_test | ++ | dept | | emp| | person | | pet| | shirt | ++ 5 rows in set (0.00 sec) mysql desc pet; +-+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +-+-+--+-+-+---+ | name| varchar(20) | YES | | NULL| | | owner | varchar(20) | YES | | NULL| | | species | varchar(20) | YES | | NULL| | | sex | char(1) | YES | | NULL| | | birth | date| YES | | NULL| | | death | date| YES | | NULL| | +-+-+--+-+-+---+ 6 rows in set (0.00 sec) mysql LOAD DATA LOCAL INFILE pet.txt INTO TABLE pet; ERROR 1148: The used command is not allowed with this MySQL version mysql mysql select version(); +--+ | version()| +--+ | 3.23.49a-max-log | +--+ 1 row in set (0.00 sec) how do i go about it..if i want to load thousands of papers data data in text file? u'r response R most appreciated. Please review 4.2.4 Security issues with LOAD DATA LOCAL =dn - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: load data local infile
Pallavi, Wednesday, November 20, 2002, 11:01:51 AM, you wrote: PAP i m using redhat linux 7.2 with mysql 3.23.49a-max-log with PAP Apache 1.3.24 . PAP i have encounter following error for load data local infile when i PAP tried to use an example on mysql site's documentation file : [skip] PAP mysql LOAD DATA LOCAL INFILE pet.txt INTO TABLE pet; PAP ERROR 1148: The used command is not allowed with this MySQL PAP version PAP how do i go about it..if i want to load thousands of PAP papers data data in text file? If you use LOAD DATA LOCAL since 3.23.49 this command should be enabled: http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: Problems with LOAD DATA LOCAL INFILE
Sorin, Saturday, October 05, 2002, 8:33:23 AM, you wrote: SC 1)Is it possible to enable LOAD DATA LOCAL INFILE from the configuration SC file? SC My.ini file is below: SC [mysqld] SC basedir=C:/mysql SC datadir=C:/mysql/data SC enable-local-infile SC local_infile=1 SC When I perform the LOAD DATA LOCAL INFILE 'file_name.txt' INTO... command SC from a client application using MyOBDC I receive the error message 1148 SC ('The used command is not allowed with this MySQL version'). SC Where is the mistake? Add local-infile=1 in the [mysql] section, too. SC The server version is 4.0.2.-alpha. SC 2)Other problems appears when I use the 3.23.47 My SQL version. SC 2.1. SC In that case LOAD DATA LOCAL INFILE 'file_name.txt' INTO... works but SC 'file_name.txt' is SC loaded just if it reside on the server. But notice that I want to load the SC file ('file_name.txt') from the client machine. SC Again, what is wrong? Hm .. It's strange. I tested it on 3.23.52 and it worked as expected. SC 2.2. SC I tried another approach for this problem and I have performed from the SC client machine a SELECT * FROM... INTO OUTFILE 'file_name.txt' command. Now, SC everything goes well and LOAD DATA LOCAL INFILE 'file_name.txt' INTO... SC works fine. It seems my troubles are finished, but... If I run again the SC same command, another new file with the same name cannot be created (because SC 'file_name.txt' already exists). How can I remove the older 'file_name.txt', SC doing this from the client side and using MyODBC? No, you can't do it with MySQL. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Problems with LOAD DATA LOCAL INFILE
I have found to do a LOAD DATA LOCAL INFILE is no longer possible using perl-DBI, even though local-infile=1 is in the [mysql], [mysqld], and [client] sections of my.cnf. I am not sure what prompted the engineering powers-that-be to change the default for this version, 3.23.49, of mysql, but it sure has caused a lot of trouble. Todd Merriman [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Problems with LOAD DATA LOCAL INFILE
I just tried the following and got ysql load data local infile /home/repett0/contact.data into table CONTACT; ERROR 1148: The used command is not allowed with this MySQL version mysql I too use perl and dbi What is going on? Thanks Ron - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Problems with LOAD DATA LOCAL INFILE
the permissions on the file and the enclosing directory (all the way up to the root dir) must allow for execution also, my.cnf need to have [mysqld] local-infile=1 #!/usr/bin/perl use DBI; $dbh = DBI-connect( dbi:mysql:databasename, 'user', 'password', { PrintError = 0 } ) or die Can't connect to mysql database: $DBI::errstr\n; $input = load data infile '/users/hcir/p99x/palmer/last/trk' into table trk; $dbh-do($input) or warn $DBI::errstr\n; $dbh-disconnect or print Disconnect failure: $DBI::errstr\n; - hcir On Monday, Oct 7, 2002, at 18:51 America/Anchorage, Ronald Petty wrote: I just tried the following and got ysql load data local infile /home/repett0/contact.data into table CONTACT; ERROR 1148: The used command is not allowed with this MySQL version mysql I too use perl and dbi What is going on? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Problems with LOAD DATA LOCAL INFILE
1)Is it possible to enable LOAD DATA LOCAL INFILE from the configuration file? My.ini file is below: [mysqld] basedir=C:/mysql datadir=C:/mysql/data enable-local-infile local_infile=1 When I perform the LOAD DATA LOCAL INFILE 'file_name.txt' INTO... command from a client application using MyOBDC I receive the error message 1148 ('The used command is not allowed with this MySQL version'). Where is the mistake? The server version is 4.0.2.-alpha. 2)Other problems appears when I use the 3.23.47 My SQL version. 2.1. In that case LOAD DATA LOCAL INFILE 'file_name.txt' INTO... works but 'file_name.txt' is loaded just if it reside on the server. But notice that I want to load the file ('file_name.txt') from the client machine. Again, what is wrong? 2.2. I tried another approach for this problem and I have performed from the client machine a SELECT * FROM... INTO OUTFILE 'file_name.txt' command. Now, everything goes well and LOAD DATA LOCAL INFILE 'file_name.txt' INTO... works fine. It seems my troubles are finished, but... If I run again the same command, another new file with the same name cannot be created (because 'file_name.txt' already exists). How can I remove the older 'file_name.txt', doing this from the client side and using MyODBC? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
'load data local infile' works on command line, but fails in php scripts
I'm having problems with php scripts that use 'LOAD DATA LOCAL INFILE'. Each time I run a script, I get an error in the server log saying MySQL query failed: LOAD DATA LOCAL INFILE : The used command is not allowed with this MySQL version. We're using php version 4.1.2 and MySQL 3.23.49, both installed using RedHat (7.3) package managers. MySQL wasn't explicitly configured using '--enable-local-infile' at installation. I've tried including 'local-infile=1' in the my.cnf file under [mysql], [mysqld], [mysql.server] etc., and this has enabled use of 'load data local infile' from the command line, but still not in php scripts. Removing the word LOCAL from the php scripts results in a different error - I get a message saying that access is denied for the user instead. I would be very grateful to hear from anyone who knows how to get round this problem. Regards, Stephen - Stephen Park Dept. Clinical Pharmacology, Royal College of Surgeons in Ireland 25 St. Stephen's Green, Dublin 2, Ireland E-mail: [EMAIL PROTECTED] Web:http://www.sdepark.net/ Tel:+353 (0)1 240 9515 Fax:+353 (0)1 240 9516 - - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
load data local infile
i have read several archives/docs on this but still can not get this to work from the mysql command line, load data local infile DOES work, am trying to get this to work from Perl $sth = $dbh-prepare(load data local infile '/users/hcir/desktop/t2/0001' into table s0001); $sth-execute() or warn : $DBI::errstr\n; returns The used command is not allowed with this MySQL version Mac OS X mysql 4.0.3 /etc/my.cnf contains [mysqld] local-infile=1 [mysql] local-infile=1 thanks - hcir - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data local infile
Try leaving out the word local. This corrected the same problem on XP Prof. BobJ - Original Message - From: nellA hciR [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Thursday, September 12, 2002 2:32 PM Subject: load data local infile i have read several archives/docs on this but still can not get this to work from the mysql command line, load data local infile DOES work, am trying to get this to work from Perl $sth = $dbh-prepare(load data local infile '/users/hcir/desktop/t2/0001' into table s0001); $sth-execute() or warn : $DBI::errstr\n; returns The used command is not allowed with this MySQL version Mac OS X mysql 4.0.3 /etc/my.cnf contains [mysqld] local-infile=1 [mysql] local-infile=1 thanks - hcir - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: load data local infile
I have had luck by removing the word LOCAL from the statement. -=Bryan=- -Original Message- From: nellA hciR [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 11:33 AM To: MySQL List Subject: load data local infile i have read several archives/docs on this but still can not get this to work from the mysql command line, load data local infile DOES work, am trying to get this to work from Perl $sth = $dbh-prepare(load data local infile '/users/hcir/desktop/t2/0001' into table s0001); $sth-execute() or warn : $DBI::errstr\n; returns The used command is not allowed with this MySQL version Mac OS X mysql 4.0.3 /etc/my.cnf contains [mysqld] local-infile=1 [mysql] local-infile=1 thanks - hcir - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data local infile
THANKS!! that works! - hcir I have had luck by removing the word LOCAL from the statement. -=Bryan=- from the mysql command line, load data local infile DOES work, am trying to get this to work from Perl $sth = $dbh-prepare(load data local infile '/users/hcir/desktop/t2/0001' into table s0001); $sth-execute() or warn : $DBI::errstr\n; returns The used command is not allowed with this MySQL version - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: Re: LOAD DATA LOCAL INFILE not allowed this version?
Uriel, Monday, September 09, 2002, 4:21:40 AM, you wrote: C:mysql -r -N fall02 \mysqluw\mysql.txt UW (i.e. using the mysql command from DOS, and running a batch file) UW And I didn't change any configuration defaults since installing mySQL on UW this machine. Put local-infile=1 in the [mysqld] and [mysql] section of my.cnf(my.ini) -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Re: LOAD DATA LOCAL INFILE not allowed this version?
THANKS VERY MUCH! That worked! - Original Message - From: Victoria Reznichenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 9:15 PM Subject: re: Re: LOAD DATA LOCAL INFILE not allowed this version? [.] Put local-infile=1 in the [mysqld] and [mysql] section of my.cnf(my.ini) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA LOCAL INFILE not allowed this version?
The command LOAD DATA LOCAL INFILE C:\\MO10.txt INTO TABLE stud1 fields terminated by / lines terminated by '\r\n'; produces: ERROR 1148 at line 1: The used command is not allowed with this MySQL vers Could someone explain why?? I'm running version MYSQL Ver 11.18 Distrib 3.23.51, for Win95/Win98 (i32) under WinXP Home standalone (i.e., no network, just one machine). I used to do this routinely under Win Me. Thanks in advance, Uriel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: LOAD DATA LOCAL INFILE not allowed this version?
One can disable all LOAD DATA LOCAL commands in the MySQL server by starting mysqld with --local-infile=0. In the case that LOAD DATA LOCAL INFILE is disabled in the server or the client, you will get the error message (1148): The used command is not allowed with this MySQL version http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html -Original Message- From: Uriel Wittenberg [mailto:[EMAIL PROTECTED]] Sent: 08 September 2002 16:24 To: [EMAIL PROTECTED] Subject: LOAD DATA LOCAL INFILE not allowed this version? The command LOAD DATA LOCAL INFILE C:\\MO10.txt INTO TABLE stud1 fields terminated by / lines terminated by '\r\n'; produces: ERROR 1148 at line 1: The used command is not allowed with this MySQL vers Could someone explain why?? I'm running version MYSQL Ver 11.18 Distrib 3.23.51, for Win95/Win98 (i32) under WinXP Home standalone (i.e., no network, just one machine). I used to do this routinely under Win Me. Thanks in advance, Uriel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: LOAD DATA LOCAL INFILE not allowed this version?
I'm not doing that. I'm doing C:mysql -r -N fall02 \mysqluw\mysql.txt (i.e. using the mysql command from DOS, and running a batch file) And I didn't change any configuration defaults since installing mySQL on this machine. - Original Message - From: Sqlcoders.com Programming Dept [EMAIL PROTECTED] To: Uriel Wittenberg [EMAIL PROTECTED]; Mysql [EMAIL PROTECTED] Sent: Monday, September 09, 2002 8:31 AM Subject: RE: LOAD DATA LOCAL INFILE not allowed this version? One can disable all LOAD DATA LOCAL commands in the MySQL server by starting mysqld with --local-infile=0. In the case that LOAD DATA LOCAL INFILE is disabled in the server or the client, you will get the error message (1148): The used command is not allowed with this MySQL version http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html -Original Message- From: Uriel Wittenberg [mailto:[EMAIL PROTECTED]] Sent: 08 September 2002 16:24 To: [EMAIL PROTECTED] Subject: LOAD DATA LOCAL INFILE not allowed this version? The command LOAD DATA LOCAL INFILE C:\\MO10.txt INTO TABLE stud1 fields terminated by / lines terminated by '\r\n'; produces: ERROR 1148 at line 1: The used command is not allowed with this MySQL vers Could someone explain why?? I'm running version MYSQL Ver 11.18 Distrib 3.23.51, for Win95/Win98 (i32) under WinXP Home standalone (i.e., no network, just one machine). I used to do this routinely under Win Me. Thanks in advance, Uriel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
Hello, Below is a thread from March. Basically, I am having the same problem in v3.23.49 (release version, not Alpha). I also have Linux RedHat 7.2, same as Tom. I compiled MySQL from source using gcc v2.96 . Here are the details of my problem: The SQL command LOAD DATA LOCAL INFILE '/home/toma/spotplay/EVD0619.EG' REPLACE INTO TABLE `TSN` FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '' works fine from a phpMyAdmin web page; however, the exact same command inside a Perl script on the same machine localhost fails with the message DBD::mysql::st execute failed: The used command is not allowed with this MySQL version at /home/toma/lib/perl5/Database/MySql.pm line 61. Can't execute SQL statement: The used command is not allowed with this MySQL version I assume this discrepancy means that phpMyAdmin is using the server, while the Perl script is a client. I have tried all of the following -- using local-infile in my.cnf as Sinisa suggests -- rerunning./configure with arg --enable-local-infile, then recompiling -- restarting safe_mysqld with --local-infile=1 I have also looked at the suggested fixes in Security issues with LOAD DATA LOCAL in the MySQL documentation at http://www.mysql.com/doc/L/O/LOAD_DATA_LOCAL.html which says among other things By default, all MySQL clients and libraries are compiled with --enable-local-infile, to be compatible with MySQL 3.23.48 and before. If that is true, and I didn't change the default the first time I compiled it, then using --local-infile=1 when starting safe_mysqld should enable LOAD DATA LOCAL INFILE, the way I read it. In any case after recompiling it should enable it. The web page also says If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients, unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0) in the client. See section 8.4.3.159 mysql_options(). That's a C function. Any way to call this from Perl? Michael Widenius [EMAIL PROTECTED] wrote: Did you give the above option to both 'mysqld' and 'mysql' ? How do I do it for mysql from inside a Perl script? Can you pass args through Perl DBI calls to this end, does anyone know? Or am I missing something more obvious? Tom Date: Mon, 04 Mar 2002 15:27:58 -0500 http://us.i1.yimg.com/us.yimg.com/i/space.gif From: Thomas Birchmire [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49] http://us.i1.yimg.com/us.yimg.com/i/space.gif CC: [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif I have the same problem using Linux RedHat 7.2. Just what do I have to configure my binary MySQL : Ver 8.23 Distrib 3.23.49a, for pc-linux-gnu on i686? The rest of MySQL works as advertised. Regards Tom Birchmire Michael Widenius [EMAIL PROTECTED] wrote: Hi! Sinisa == Sinisa Milivojevic [EMAIL PROTECTED] writes: Sinisa [EMAIL PROTECTED] writes: Description: LOAD DATA LOCAL INFILE ... leads to 'The used command is not allowed with this MySQL version' This happens regardless of whether I have a local-infile = 1 in my /etc/my.cnf. In neither case does the local-infile variable show up with SHOW VARIABLES. We don't have a status variable that shows if this feature is enabled or not. The above is quite strange as I did test this properly before doing a release. Did you give the above option to both 'mysqld' and 'mysql' ? Which MySQL distribution are you using ? Sinisa Hi! Sinisa A new startup variable : Sinisa --local-infile Sinisa must be used to enable the above feature. That is what the user described that he did do... Regards, Monty - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Attachment: Forwarded Message From: Sinisa Milivojevic [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif Date: Tue, 5 Mar 2002 14:43:23 +0200 http://us.i1.yimg.com/us.yimg.com/i/space.gif To: [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif CC: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49] http://us.i1.yimg.com/us.yimg.com/i/space.gif Thomas Birchmire writes: I have the same problem using Linux RedHat 7.2. Just what do I have to configure my binary MySQL : Ver 8.23 Distrib 3.23.49a, for pc-linux-gnu on i686? The rest of MySQL works as advertised. Regards Tom Birchmire loca-infile is not a variable. Therefore, you either start a server with --local-infile
LOAD DATA LOCAL INFILE
Before I get started, let me say that I have looked at the manual, gone through a number of posts to the lists and read Paul's MySQL book. I've tried a lot of things over the course of the past three hours and am hoping that someone can shed some light on this one. When I do the load data local infile, everything drops in fine EXCEPT for the last field in the list. It comes in blank and usually gives me an error. Here is a sample of my .csv file: Texas AM University,College Station, TX,1999,Design, install, test and run blah, blah.,Whatever Industry Here is ONE of the many syntaxes I've tried that looks like it should cover it all: LOAD DATA INFILE 'd:\\text.csv' INTO TABLE projects FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '\\' LINES TERMINATED BY '\n'; But no. No matter what I try, .txt files, .csv files, with returns, without, the last field always gets dropped. I'm at my wits end, and that's a short trip on a GOOD day. The text file is done in wordpad or notepad and saved as plain text. Running on an NT server. Any help is appreciated. Thanks. Brent - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: LOAD DATA LOCAL INFILE
[snip] Texas AM University,College Station, TX,1999,Design, install, test and run blah, blah.,Whatever Industry LOAD DATA INFILE 'd:\\text.csv' INTO TABLE projects FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '\\' LINES TERMINATED BY '\n'; [/snip] Have you tried this... LOAD DATA INFILE 'd:\\text.csv' INTO TABLE projects FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'; HTH! Jay sql,query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: LOAD DATA LOCAL INFILE
[snip] Texas AM University,College Station, TX,1999,Design, install, test and run blah, blah.,Whatever Industry LOAD DATA INFILE 'd:\\text.csv' INTO TABLE projects FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '\\' LINES TERMINATED BY '\n'; Have you tried this... LOAD DATA INFILE 'd:\\text.csv' INTO TABLE projects FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'; [/snip] Can you post a description of your table, DESCRIBE tablename? HTH! Jay sql,query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA LOCAL INFILE
Before I get started, let me say that I have looked at the manual, gone through a number of posts to the lists and read Paul's MySQL book. I've tried a lot of things over the course of the past three hours and am hoping that someone can shed some light on this one. When I do the load data local infile, everything drops in fine EXCEPT for the last field in the list. It comes in blank and usually gives me an error. Here is a sample of my .csv file: Texas AM University,College Station, TX,1999,Design, install, test and run blah, blah.,Whatever Industry Here is ONE of the many syntaxes I've tried that looks like it should cover it all: LOAD DATA INFILE 'd:\\text.csv' INTO TABLE projects FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\' ESCAPED BY '\\' LINES TERMINATED BY '\n'; But no. No matter what I try, .txt files, .csv files, with returns, without, the last field always gets dropped. I'm at my wits end, and that's a short trip on a GOOD day. The text file is done in wordpad or notepad and saved as plain text. Running on an NT server. Any help is appreciated. Thanks. Brent - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA LOCAL INFILE problem with MySQL 4.0.1-alpha on RH7.3
Hi list! I have a problem when trying to read data into tables with LOAD DATA LOCAL INFILE. I get this error: ERROR 2013: Lost connection to MySQL server during query When looking at the MySQL site it says that I should increase the max_allowed_packet=# option (default 1M). However, my file is not that big, since it is only 226 byte. It also suggests that I should check the uptime of the mysqld, so I can verify that it hasn't crashed. issuing the 'mysqladmin version' command gives this: Server version 4.0.1-alpha Protocol version10 Connection Localhost via UNIX socket UNIX socket /var/lib/mysql/mysql.sock Uptime: 22 hours 22 min 52 sec so, the server hasn't crashed... I am not 100% sure if I am starting mysqld in the correct manner however. The my.cnf for the server is in /var/lib/mysql/my.cnf, which looks like this: [client] port= 3306 host= localhost [safe_mysqld] open-files-limit=8192 socket=/var/lib/mysql/mysql.sock max_allowed_packet=2M Probably this .cnf file is not sufficient, but I hope that somebody might help me in the right direction :) Thnx, Patrik Birgersson - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Re: problem with load data local infile
At 23:34 -0500 4/20/02, Darren Vollmer wrote: Both files are world readable. How do you know this? Because FTP tells me they are. Also, when you say client machine, what do you mean? In particular, are the web server and the MySQL servers running on the same machine? Client machine is the machine running the webserver and MySQL client. The host machine runs the actual MySQL server. Are they the same or different? Your answer doesn't actually specify. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: problem with load data local infile
Darren, Friday, April 19, 2002, 3:33:50 PM, you wrote: DV I am having problems with load data local infile. DV The mysql host server is running 3.23.23 DV I was able to successfully use load data local infile before to import data DV off of a client machine onto the mysql host but now all i get is a DV can't stat file errcode2 message. DV I know that the pathname I am using is correct. DV What would keep the mysql server from being able to see the file? 1. Does the file exist there? 2. Does MySQL have permissions on the file and dirs? DV Thanks -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: problem with load data local infile
The file does exist. The file and its directory are 0777 permission. Darren - Original Message - From: Victoria Reznichenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 20, 2002 4:32 AM Subject: Re: problem with load data local infile Darren, Friday, April 19, 2002, 3:33:50 PM, you wrote: DV I am having problems with load data local infile. DV The mysql host server is running 3.23.23 DV I was able to successfully use load data local infile before to import data DV off of a client machine onto the mysql host but now all i get is a DV can't stat file errcode2 message. DV I know that the pathname I am using is correct. DV What would keep the mysql server from being able to see the file? 1. Does the file exist there? 2. Does MySQL have permissions on the file and dirs? DV Thanks -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Re: problem with load data local infile
Darren, Saturday, April 20, 2002, 1:23:54 PM, you wrote: DV The file does exist. The file and its directory are 0777 permission. Such permissions are setting on all dirs, that contain path to your dir? Don't forget that you should have permissions to go through dirs ... DV Darren -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Re: Re: problem with load data local infile
Darren, Saturday, April 20, 2002, 2:34:06 PM, you wrote: DV The file is in a world readable directory tree. DV Shouldn't the LOCAL qualifier make mysql read the file from the client DV running and not the host? DV I tried to LOAD DATA LOCAL INFILE on using the name (and no path) of a mysql DV FRM file that is in the databases directory on the Mysql host. The server DV found the file even though I specified local. Don't know if that means DV anything or not, or if that is normal mysql behavior. DV exp; DV load data local infile 'table.frm' replace into table testtable DV Shouldn't mysql be looking for table.frm on my client machine and not the DV server? Have you changed the client software? What is your client version? -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php