title: Automate mysql_secure_installation with echo command via a shell script
body: <p>I am trying to automate mysql_secure_installation script with automated response. My code is as follows :</p>
  
  <pre><code>echo "&amp; y y abc abc y y y y" | ./usr/bin/mysql_secure_installation
  </code></pre>
  
  <p>The actual questions which i am automating are as follows:</p>
  
  <pre><code>Enter current password for root (enter for none): &lt;enter&gt;
  Set root password? [Y/n] y
  New password: abc
  Re-enter new password: abc
  Remove anonymous users? [Y/n] y
  Disallow root login remotely? [Y/n] y
  Remove test database and access to it? [Y/n] y
  Reload privilege tables now? [Y/n] y
  </code></pre>
  
  <p>But it gives me an error "Sorry you cannot use an empty password here" but in the screen i used to press the return key for the first question.</p>