<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Excel into MySQL..How?!</title>
	<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow/</link>
	<description>Comments on Ask MetaFilter post Excel into MySQL..How?!</description>
	<pubDate>Wed, 05 Dec 2007 14:57:42 -0800</pubDate>
	<lastBuildDate>Wed, 05 Dec 2007 14:57:42 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Excel into MySQL..How?!</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow</link>	
		<description>I&apos;ve been trying to get a 600 record Excel database into MySQL, and failed at every turn. There must be a way! &lt;br /&gt;&lt;br /&gt; I&apos;m getting really fed up with this now, but I have to get it working in the next week or so.&lt;br&gt;
&lt;br&gt;
I have a 600 record database in Excel that I need to import into a MySQL database so that I can generate a nice HTML page of the content (or selected bits of it).&lt;br&gt;
&lt;br&gt;
I&apos;ve got it exported as a CSV, but MyPHPAdmin fails to import it saying &quot;Invalid field count in CSV input on line 1.&quot;, but I&apos;ve checked and I have 30 fields in the CSV and in the database.&lt;br&gt;
&lt;br&gt;
All other options seem to be software costing money. There must be something I&apos;m missing!</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.77922</guid>
		<pubDate>Wed, 05 Dec 2007 14:53:53 -0800</pubDate>
		<dc:creator>lemonfridge</dc:creator>
		
			<category>excel</category>
		
			<category>mysql</category>
		
			<category>phpadmin</category>
		
			<category>php</category>
		
	</item> <item>
		<title>By: oh pollo!</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157569</link>	
		<description>Are there commas in any of the data in CSV file?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157569</guid>
		<pubDate>Wed, 05 Dec 2007 14:57:42 -0800</pubDate>
		<dc:creator>oh pollo!</dc:creator>
	</item><item>
		<title>By: Mach5</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157574</link>	
		<description>Are you sure your feeding phpmyadmin the right column and row delimiters?  And are you absolutely sure you have the field count perfect, and your column types are good?  This is something you can do quickly with Python (or really any other scripting language), provided you have basic coding skills.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157574</guid>
		<pubDate>Wed, 05 Dec 2007 15:00:13 -0800</pubDate>
		<dc:creator>Mach5</dc:creator>
	</item><item>
		<title>By: lemonfridge</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157583</link>	
		<description>So how can I do this, step by step, from Excel to MySQL, with my limited PHP knowledge?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157583</guid>
		<pubDate>Wed, 05 Dec 2007 15:05:39 -0800</pubDate>
		<dc:creator>lemonfridge</dc:creator>
	</item><item>
		<title>By: junesix</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157586</link>	
		<description>Follow the directions &lt;a href=&quot;http://forums.oscommerce.com/index.php?showtopic=172479&quot;&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
Did you change the &quot;Fields terminated by&quot; option to the comma?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157586</guid>
		<pubDate>Wed, 05 Dec 2007 15:11:07 -0800</pubDate>
		<dc:creator>junesix</dc:creator>
	</item><item>
		<title>By: xmutex</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157597</link>	
		<description>Could try mysql&apos;s native &lt;a href=&apos;http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Fmysql%2Fen%2FLOAD_DATA.html&amp;ei=_jJXR_SHD6CsiAGJ6N3dBg&amp;usg=AFQjCNH4bosxst1ZcerAO6DbMGLL5sx4xQ&amp;sig2=1eISrcbn-oKSDAH951hFMg&apos;&gt;LOAD DATA INFILE&lt;/a&gt; method.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157597</guid>
		<pubDate>Wed, 05 Dec 2007 15:24:34 -0800</pubDate>
		<dc:creator>xmutex</dc:creator>
	</item><item>
		<title>By: erpava</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157627</link>	
		<description>In the Excel file, try selecting a whole bunch of columns and rows outside of your data and deleting them. There may be an errant space or break in there somewhere. I seem to recall having a similar problem to yours and this may have fixed it.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157627</guid>
		<pubDate>Wed, 05 Dec 2007 15:47:16 -0800</pubDate>
		<dc:creator>erpava</dc:creator>
	</item><item>
		<title>By: pompomtom</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157632</link>	
		<description>I don&apos;t use MySQL, but if it&apos;s just 600 records, could you not chuck a formula into your excel sheet to generate an insert line for each record?&lt;br&gt;
&lt;br&gt;
like:&lt;br&gt;
&lt;br&gt;
=&quot;INSERT INTO table VALUES (&quot;&amp;amp;A1&amp;amp;&quot;,&quot;&amp;amp;A2&amp;amp;&quot;,&quot;&amp;amp;A3&amp;amp;&quot;)&quot;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
and just run that.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
(after checking for commas in your data, like everyone says!)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157632</guid>
		<pubDate>Wed, 05 Dec 2007 15:48:58 -0800</pubDate>
		<dc:creator>pompomtom</dc:creator>
	</item><item>
		<title>By: seanyboy</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157660</link>	
		<description>You could have blank columns (i.e. no title on the column) at the end of your csv file. &lt;br&gt;
&lt;br&gt;
To import into mySQL, Copy the columns you want to import into a new excel file then export that as CSV.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157660</guid>
		<pubDate>Wed, 05 Dec 2007 16:24:09 -0800</pubDate>
		<dc:creator>seanyboy</dc:creator>
	</item><item>
		<title>By: qvtqht</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157697</link>	
		<description>If you&apos;re using pompomtom&apos;s solution, you should check your data for single quotes or double quotes, depending on which one you use to enclose strings in the SQL query.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157697</guid>
		<pubDate>Wed, 05 Dec 2007 16:55:16 -0800</pubDate>
		<dc:creator>qvtqht</dc:creator>
	</item><item>
		<title>By: fishfucker</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157725</link>	
		<description>Everytime I need to do this, it&apos;s usually an edge case, so I just download a trial version of &lt;a href=&quot;http://www.navicat.com/&quot;&gt;Navicat&lt;/a&gt; and do the import. It has never failed me, unlike the free XLS parsing libraries available, which are usually crap. &lt;br&gt;
&lt;br&gt;
If you need to do this regularly, I&apos;ve had luck with converting XLSes to XML, and then using an XML parser to generate SQL insert queries. A little stupid, but I&apos;ve never had a need to do it more often than a couple times a month, so I always took the half-assed way out.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157725</guid>
		<pubDate>Wed, 05 Dec 2007 17:07:42 -0800</pubDate>
		<dc:creator>fishfucker</dc:creator>
	</item><item>
		<title>By: scottreynen</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157734</link>	
		<description>I had this same problem last week. After a lot of Google searching, I never found a good solution for it (ended up making a lot of fixes by hand), but I can tell you where the problems are: either MySQL or Excel fail to follow the &lt;a href=&quot;http://tools.ietf.org/html/rfc4180&quot;&gt;CSV RFC&lt;/a&gt; in various places.&lt;br&gt;
&lt;br&gt;
MySQL fails to adhere to section 2.6: &quot;Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes,&quot; specifically the part about line breaks. MySQL also fails section 2.7: &quot;If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote.&quot; Excel, for it&apos;s part, fails to adhere to section 2.4: &quot;Each line should contain the same number of fields throughout the file.&quot; &lt;br&gt;
&lt;br&gt;
The combination of the two failing to follow the standard in different ways makes them not play well together.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157734</guid>
		<pubDate>Wed, 05 Dec 2007 17:10:26 -0800</pubDate>
		<dc:creator>scottreynen</dc:creator>
	</item><item>
		<title>By: drezdn</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157800</link>	
		<description>One thing I&apos;ve found helpful to find the problem was to take one or two lines of the excel file, try to export them as a csv file that imports through phpmyadmin.&lt;br&gt;
&lt;br&gt;
The last time I had this problem, it was because the number of fields was off (but you&apos;ve already checked that). Try playing around with quoting out your sample data.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157800</guid>
		<pubDate>Wed, 05 Dec 2007 17:55:18 -0800</pubDate>
		<dc:creator>drezdn</dc:creator>
	</item><item>
		<title>By: cbrody</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157848</link>	
		<description>I had similar issues with a one-off import and found a tool that worked for me: SoftGalaxy&apos;s &lt;a href=&quot;http://www.softgalaxy.net/excel-mysql/index.html&quot;&gt;Excel MySql Converter&lt;/a&gt;. It&apos;s not free ($38) but it did the job &amp;amp; saved a lot of time.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157848</guid>
		<pubDate>Wed, 05 Dec 2007 18:28:55 -0800</pubDate>
		<dc:creator>cbrody</dc:creator>
	</item><item>
		<title>By: Yavsy</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1157931</link>	
		<description>I like &lt;a href=&quot;http://www.heidisql.com/&quot;&gt;HeidiSQL&lt;/a&gt;:  a free, easy to use MySQL GUI.  I&apos;ve imported cvs files with it before, and it worked very well.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.77922-1157931</guid>
		<pubDate>Wed, 05 Dec 2007 19:45:09 -0800</pubDate>
		<dc:creator>Yavsy</dc:creator>
	</item><item>
		<title>By: GregX3</title>
		<link>http://ask.metafilter.com/77922/Excel-into-MySQLHow#1548019</link>	
		<description>I made a simple web based tool to do exactly this; &lt;a href=&quot;http://utilitymill.com/utility/csv_to_create_table&quot;&gt;an online utility to turn a spreadsheet into a MySQL table.&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
(I&apos;m probably a year too late to help you, but I was excited to see someone having a use for my tool)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.77922-1548019</guid>
		<pubDate>Thu, 20 Nov 2008 17:34:34 -0800</pubDate>
		<dc:creator>GregX3</dc:creator>
	</item>
	</channel>
</rss>
