title: Create table automatically according to input file in mysql
body: <p>I have a file with large number of columns and I want to input this file in mysql table.</p>
  
  <p>The thing is if we have file with, say, 8 columns then we will first create table by -</p>
  
  <pre><code>CREATE TABLE `input` (
    `idInput` varchar(45) DEFAULT NULL,
    `row2` varchar(45) DEFAULT NULL,
    `col3` varchar(45) DEFAULT NULL,
    `col4` varchar(45) DEFAULT NULL,
    `col5` varchar(45) DEFAULT NULL,
    `col6` varchar(45) DEFAULT NULL,
    `col7` varchar(45) DEFAULT NULL,
    `col8` varchar(45) DEFAULT NULL
  );
  </code></pre>
  
  <p>then we will input the file by -</p>
  
  <pre><code>LOAD DATA INFILE "FILE" INTO TABLE input;
  </code></pre>
  
  <p>But the thing is, I have file with 150 columns and I want to insert this file in mysql table automatically (so that I should not have to create table first). The first row of my file is header and it should be as column names in table and also each column and each row has different datatype.</p>
  
  <p>So is there any easy way to do this so that after that I can do different things with this table?</p>
  
  <p>I am using mysql command line client version 5.5.20 (windows 7).</p>