title: create insert if not exist in mysql
body: <p>In MySql we can choose <code>INSERT IGNORE(do not update existing)</code> to generate a sql file with query <code>CREATE TABLE IF NOT EXISTS</code> and  <code>INSERT IGNORE INTO</code>.</p>
  
  <p>But in this case,if the table exists, the "INSERT IGNORE INTO" will insert data again.
     I'd like to ask,is there a method, to realize the function: If table doesn't exist, it will create the table and insert data. </p>
  
  <p>If the table exists, it will not insert data.</p>
  
  <p>In fact I have tried how to realize, I know with a stored procedure it is possible, but with a sql file which will be executed by batch file, how to realize the function?   </p>
  
  <p>My curent code is like this</p>
  
  <pre><code>CREATE DATABASE IF NOT EXISTS martintest;
  
  USE martintest; 
  CREATE TABLE IF NOT EXISTS `martin1` (
    `col1` int(11) default NULL,
    `col2` text
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  
  INSERT IGNORE INTO `martin1` (`col1`, `col2`) VALUES    (2, 'bbb'), (1, 'aaa');
  </code></pre>