<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Mon, 29 Jun 2009 15:41:08 -0000</lastBuildDate><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-11908168</link><description>I wanted to add the fact that I already have my database set up in MySQL with all the appropriate tables. I created a test CSV file and messed around with it a bit but wasn't sure where and how I was supposed to implement it using the code you have given.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mindy</dc:creator><pubDate>Mon, 29 Jun 2009 15:41:08 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-11908071</link><description>Ok, I must be missing something here. Are there more explicit instructions for this? Do I paste this code using phpmyadmin and putting it into the sql box? I'm a little lost here.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mindy</dc:creator><pubDate>Mon, 29 Jun 2009 15:38:32 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-9848310</link><description>thanks very much</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Okpali D Great</dc:creator><pubDate>Sun, 24 May 2009 01:42:55 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-9848261</link><description>the above code is can do it. You need to specify the url of the csv file with / slash and not \ .</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Okpali D Great</dc:creator><pubDate>Sun, 24 May 2009 01:38:42 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-9145960</link><description>@ir:&lt;br&gt;If the passwords in your CSV file are not already MD5() then just import them as per the instructions above then run this query:&lt;br&gt;&lt;br&gt;UPDATE `users` SET `password` = MD5(`password`);&lt;br&gt;&lt;br&gt;@ashish:&lt;br&gt;That is the "full code".  There is no more.  The only step you have to do before this is to create a table that matches the CSV file you already have.  No one can tell you how to do that without having your CSV file.  Don't forget to modify the query above to match the table you have just created.&lt;br&gt;&lt;br&gt;@zlid:&lt;br&gt;No it can't.  Fields are given names and types at the same time when the table is created.  To assign the names automatically, MySQL would have to also assign the column types automatically which would mean scanning down through the entire CSV file to make sure that there were no letters in a column that started with numbers and finding the longest string in a column that started with a string and so on.  There are too many options in table creation to allow it to be left up to software.  NULL or NOT NULL ?  DATE, DATETIME, TIME, CHAR, VARCHAR or TEXT ?  What if you have a column full of numbers but one Excel error message that looks like "#value" ?&lt;br&gt;&lt;br&gt;You will have to create the table yourself before importing the CSV file.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave</dc:creator><pubDate>Fri, 08 May 2009 21:38:03 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-8692084</link><description>Thank you very much.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Partha Kar</dc:creator><pubDate>Sat, 25 Apr 2009 18:31:00 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-8178579</link><description>where to place the csv file...</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vasu</dc:creator><pubDate>Tue, 14 Apr 2009 03:33:20 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-6367889</link><description>Can MySQL automatically assign the column names using the column headers from the csv file?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zild</dc:creator><pubDate>Wed, 18 Feb 2009 00:15:34 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-5861503</link><description>hey &lt;br&gt; please send full code of importing file into mysql database. at my email (&lt;a href="mailto:ashish@tiainterweb.com" rel="nofollow"&gt;ashish@tiainterweb.com&lt;/a&gt;)&lt;br&gt;thanks</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashish</dc:creator><pubDate>Thu, 05 Feb 2009 05:04:21 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-5799224</link><description>help!! can this be possible??&lt;br&gt;(idnum,username,md5(password))&lt;br&gt;how about if i used md5 in my password??&lt;br&gt;and i want my password field converted into md5.&lt;br&gt;email me pls. &lt;a href="mailto:ir_bs756@yahoo.com" rel="nofollow"&gt;ir_bs756@yahoo.com&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ir</dc:creator><pubDate>Mon, 02 Feb 2009 23:02:42 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-4589527</link><description>very very superb 1 line query.. i love it !!!!!!!!!!!!!!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">priyadarshan</dc:creator><pubDate>Tue, 23 Dec 2008 10:28:28 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-4122454</link><description>Thank you Thank you.  Very nice.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris</dc:creator><pubDate>Tue, 02 Dec 2008 00:59:30 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-3308503</link><description>Thank you!!! it really works !!!&lt;br&gt;&lt;br&gt;Copied the csv file into  /var/lib/mysql/mydb at my ubuntu box.&lt;br&gt;&lt;br&gt;*mydb is the name of my database</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashikur</dc:creator><pubDate>Sun, 26 Oct 2008 03:22:47 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-3220641</link><description>thanks pal! finally somethin' working :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">robert</dc:creator><pubDate>Tue, 21 Oct 2008 21:28:28 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-2975524</link><description>Thanks, buddy!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ng</dc:creator><pubDate>Fri, 10 Oct 2008 01:49:23 -0000</pubDate></item><item><title>Re: Import CSV file directly into MySQL | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/#comment-2918673</link><description>Thank you. Short and sweet. Very straight to the point.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rafael</dc:creator><pubDate>Tue, 07 Oct 2008 11:39:47 -0000</pubDate></item></channel></rss>