title: MYSQL SHELL - SQL MODE from SHELL SCRIPT
body: <p>I am writing a shell script to run a sql select query using mysqlsh.</p>
  
  <p>So I had some issues and I found that I need to use "\sql" to change it from </p>
  
  <p>mysql-js> to mysql-sql></p>
  
  <p>I need to run /sql before I run the query from a file.</p>
  
  <pre><code>"C:\mysql-shell-1.0.11-windows-x86-64bit\bin\mysqlsh.exe" echo \sql | mysql://user@IP:PORT?schema=SCHEMANAME&amp;password=PASSWORD
  </code></pre>
  
  <p>and then execute this to run the select query and save it to a tmpfile.txt</p>
  
  <pre><code>"C:\mysql-shell-1.0.11-windows-x86-64bit\bin\mysqlsh.exe" --file "$EDIR"/data/tmp.sql &gt; "$EDIR"/data/tmpfile.txt 2&gt;&amp;1
  </code></pre>
  
  <p>I am not sure what am missing. I tried different alternatives,</p>
  
  <p>I am getting the below error on the first line
  <strong>"data_extractss.sh: line 53: mysql://user@IP:PORT?schema=SCHEMANAME&amp;password=PASSWORD: No such file or directory"</strong></p>
  
  <p>Any suggestion is appreciated.</p>