title: Bash Script Mysql Warning: Using a password on the command line interface can be insecure
body: <p>Hi I have a script to partition some mysql databases. We are upgrading from 5.5 to 5.6. While testing the scripts i noticed that with the new 5.6 version mysql returns <code>Warning: Using a password on the command line interface can be insecure.</code> what is the best way to fix this? I read a workaround would be <code>2&gt;/dev/null</code> but I wont be able to get the exit code or any errors if they happen. Is there any other way to do this. Here is the problematic line of code:</p>
  
  <pre><code>MYSQL_RESULT=`echo "SET sql_log_bin=0;SET @pdb='$DB',@ptable='$table';CALL maintenance(@pdb,@ptable);SET sql_log_bin=1;"|mysql -uUSER -pPASSWORD database`
  </code></pre>