<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tech-Recipes - Latest Comments in Import CSV file directly into MySQL</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><atom:link href="https://tech-recipes.disqus.com/import_csv_file_directly_into_mysql_mysql_tech_recipes/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 09 Aug 2011 14:05:21 -0000</lastBuildDate><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-281400184</link><description>&lt;p&gt;I was having the same problem and my line terminator ended up being '\r' but some others might be '\r\n'&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Keira Heu-Jwyn Chang</dc:creator><pubDate>Tue, 09 Aug 2011 14:05:21 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-278214342</link><description>&lt;p&gt;update `table_name` set `feild_name1` = '$variable1' , `feild_name2` = '$variable2';&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mandeep</dc:creator><pubDate>Fri, 05 Aug 2011 06:21:54 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-278213844</link><description>&lt;p&gt;$data = fgetcsv($filename,1000,',')&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mandeep</dc:creator><pubDate>Fri, 05 Aug 2011 06:19:57 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-266550399</link><description>&lt;p&gt;The same, happens to me. Do you know how can I solve this problems. Please if you can help me you can send me an email at jary.hernandez@gmail.com. Thanks!!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jary Hernandez</dc:creator><pubDate>Wed, 27 Jul 2011 12:42:36 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-255877325</link><description>&lt;p&gt;How can I "UPDATE" data not adding new data? Can anybody help me?      &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Iyap77</dc:creator><pubDate>Mon, 18 Jul 2011 01:16:38 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-255875426</link><description>&lt;p&gt;How can I "UPDATE" date not add new data? Can anybody help me?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Iyap77</dc:creator><pubDate>Mon, 18 Jul 2011 01:07:56 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-253744907</link><description>&lt;p&gt;HI., &lt;/p&gt;&lt;p&gt;Simple to do...... write the script as below:&lt;/p&gt;&lt;p&gt;load data local infile 'D:/DB Scripts/test.csv' into table scr_component_risks&lt;br&gt;fields terminated by ','&lt;br&gt;enclosed by '"'&lt;br&gt;lines terminated by '\n'&lt;br&gt;(give here all the columns for which you're importing the field values separated by comma);&lt;/p&gt;&lt;p&gt;use above and ur done..... &lt;br&gt;Nice. :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Pseudo003</dc:creator><pubDate>Sat, 16 Jul 2011 08:45:12 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-238485715</link><description>&lt;p&gt;Hi, I am importing a .csv file to mysql and it imports 1 to 133 records but then gives this error "Invalid field count in CSV input on line 133." . What should i do.&lt;/p&gt;&lt;p&gt;Thanks in advance&lt;br&gt;Harminder Singh&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Harminder singh</dc:creator><pubDate>Thu, 30 Jun 2011 03:21:39 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-237218114</link><description>&lt;p&gt;Thanks  saved my 2 hours......... &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Cinto Thomas</dc:creator><pubDate>Tue, 28 Jun 2011 19:13:31 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-198174417</link><description>&lt;p&gt;@vgurudev Thanks a lot, saves lot of time. &lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vijayanand Gurudev</dc:creator><pubDate>Fri, 06 May 2011 02:00:05 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-198158952</link><description>&lt;p&gt;Thanks a lot&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Munir hussain</dc:creator><pubDate>Fri, 06 May 2011 00:46:02 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-187860958</link><description>&lt;p&gt;If you are in a Linux OS you can use a cron job (/etc/crontab) to run a php script or something similar.  In Windows you will have to create a scheduled task and run a batch script or something similar.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott</dc:creator><pubDate>Tue, 19 Apr 2011 16:00:38 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-186841913</link><description>&lt;p&gt;me too... :(&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Asd</dc:creator><pubDate>Mon, 18 Apr 2011 06:42:11 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-179920912</link><description>&lt;p&gt;Excellent post.  Very quick and readily launchable from PHP, unlike direct dump or messy scripts.  Quite helpful.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">atrichtc</dc:creator><pubDate>Thu, 07 Apr 2011 12:59:43 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-151083431</link><description>&lt;p&gt;Thanx for Information &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikamvishvajeet</dc:creator><pubDate>Fri, 18 Feb 2011 05:34:34 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-135838307</link><description>&lt;p&gt;Thank you for the path. This was the only unknown. Great post from all. Thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steve</dc:creator><pubDate>Fri, 28 Jan 2011 01:02:55 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-128816348</link><description>&lt;p&gt;Hi, Is there a script that can help automatically import this file on a daily basis?&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KG</dc:creator><pubDate>Thu, 13 Jan 2011 16:56:56 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-121049197</link><description>&lt;p&gt;hi,&lt;br&gt;      but i cant able to import dat time info... whats wrong i dont know.. can you tell if you know...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">karuna</dc:creator><pubDate>Thu, 30 Dec 2010 05:27:13 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-121045225</link><description>&lt;p&gt;hi,...&lt;br&gt;    i am also unable to upload the date and time through this, but it works when you change the system time to the corresponding date format of your CSV data...&lt;/p&gt;&lt;p&gt;try it..&lt;/p&gt;&lt;p&gt;Jeyanthi,  jeyanthi1983@gmail.com&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jeyanthi</dc:creator><pubDate>Thu, 30 Dec 2010 04:51:14 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-117288174</link><description>&lt;p&gt;Excellent, for phpadmin users in Windows, remember to comment out the back slashes and use relative path and it works perfectly. Here is mine&lt;/p&gt;&lt;p&gt;load data local infile 'C:\\xampp\\mysql\\data\\eweek\\alfa.csv' into table alabama&lt;br&gt;fields terminated by ','&lt;br&gt;lines terminated by '\n'&lt;br&gt;(abcear,abcde,abcde,xyz,123xyzl, abcdef);&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Okaatech</dc:creator><pubDate>Wed, 22 Dec 2010 16:53:59 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-108997598</link><description>&lt;p&gt;I am using the same query . it excute properly but csv data is not being inserted into the table. Instead of the csv data a garbage data is being saved into table.&lt;/p&gt;&lt;p&gt;please any body can tell me why it been happening and how to resolve it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vish</dc:creator><pubDate>Wed, 08 Dec 2010 23:42:42 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-92916619</link><description>&lt;p&gt;if i want to select only a particular column  from my csv file and insert into mysql database.. which syntax i have to use  to get it without  making remaining columns of the table  as null values&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bhavya</dc:creator><pubDate>Tue, 02 Nov 2010 03:11:16 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-89618441</link><description>&lt;p&gt;Thanks for the additional information!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">qdideas</dc:creator><pubDate>Sun, 24 Oct 2010 08:54:42 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-89576634</link><description>&lt;p&gt;I went to the directory where I placed the csv files, placed the above code into its own file "create.sql" and then launched mysql client ie "mysql -u root -p". Next I made sure I selected the db ie "use someDB;" then issued the command "\. create.sql" and the data got there. Works well.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">rob</dc:creator><pubDate>Sun, 24 Oct 2010 02:43:31 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-88211829</link><description>&lt;p&gt;thank you its working. keep it up!!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rajmahendran</dc:creator><pubDate>Tue, 19 Oct 2010 10:55:37 -0000</pubDate></item></channel></rss>