title: MySQL load data: This command is not supported in the prepared statement protocol yet
body: <p>I'm trying to write a MySQL script to import data into a table for my Linux server. Here is the script named <code>update.sql</code>:<br></p>
  
  <pre><code>SET @query = CONCAT("LOAD DATA LOCAL INFILE '", @spaceName, "' INTO TABLE tmp FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';"); 
  PREPARE stmt FROM @query;
  EXECUTE stmt;
  DEALLOCATE PREPARE stmt;
  </code></pre>
  
  <p>And also, I write a bash script named <code>main.sh</code>:<br></p>
  
  <pre><code>mysql -h "localhost" -u "root" "-pmypassword" "mydb" -e "set @spaceName=\"$1\";source update.sql;"
  </code></pre>
  
  <p>Then I execute <code>./main.sh France.list</code>. The <code>France.list</code> is the data file that I'm trying to import into my database.<br></p>
  
  <p>However I get an error:<br></p>
  
  <blockquote>
    <p>ERROR 1295 (HY000) at line 2 in file: 'update.sql': This command is
    not supported in the prepared statement protocol yet</p>
  </blockquote>
  
  <p>I've found this question:<br>
  <a href="https://stackoverflow.com/questions/25380903/mysql-load-data-infile-with-variable-path">MySQL - Load Data Infile with variable path</a></p>
  
  <p>So, does it mean that there is no way to pass arguments to <code>LOAD DATA</code> query?</p>