title: How to run a .sql file as part of a MySQL Workbench 6.2 query?
body: <p>I'm using MySQL Workbench 6.2 [Windows7] and I want to create a script with all my steps. Among the steps, I have a series of .sql files stored from on my computer that create and populate tables. 
  I want to run these files from the query tab but every time I use this command:</p>
  
  <p>source C:/Users/[username]/Desktop/sampdb/create_president.sql;</p>
  
  <p>I get an  Error 1064, which says </p>
  
  <blockquote>
    <p>"Error Code: 1064. You have an error in your
    SQL syntax; check the manual that corresponds to your MySQL server
    version for the right syntax to use near 'mysql> source
    C:/Users/[username]/Desktop/sampdb/create_president.sql at line 1 "</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/0fOk3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0fOk3.png" alt="MySQL nested script nightmare"></a></p>
  
  <p>Can anyone tell me what I'm doing wrong? How can I refer to a .sql file within a MySQL Workbench script?</p>
  
  <p>What code should I use in the MySQL Workbench instead of <code>source</code>? I have tried <code>LOAD DATA LOCAL INFILE 'C:/Users/[username]/Desktop/sampdb/create_president.sql';</code> but it didn't work either. Any idea what can be wrong?</p>
  
  <p>*Just for additional information, create_president.sql contains the following code:</p>
  
  <pre><code>DROP TABLE IF EXISTS president;
  #@ _CREATE_TABLE_
  CREATE TABLE president
  (
    last_name  VARCHAR(15) NOT NULL,
    first_name VARCHAR(15) NOT NULL,
    suffix     VARCHAR(5) NULL,
    city       VARCHAR(20) NOT NULL,
    state      VARCHAR(2) NOT NULL,
    birth      DATE NOT NULL,
    death      DATE NULL
  );
  </code></pre>