title: MySQL commands running in shell script possess an error
body: <p>I am preparing a automated shell script but MySQL commands running in shell script possess an Warning: Using a password on the command line interface can be insecure and error of .sock.
  Please Help me...
  My Code is:</p>
  
  <pre><code>user="root"
  password="7layer"
  db="mysql"
  mysql -u "$user" -p"$password"  &lt;&lt;EOF
    use $db;
  mysqld_safe --skip-grant-tables
  update user set Password=PASSWORD('7layer') where user='root';
  UPDATE mysql.user SET password_expired='N' WHERE User='root';
  FLUSH PRIVILEGES;
  exit;
  EOF
  </code></pre>
  
  <p>The Output is:</p>
  
  <pre><code>Starting MySQL.                                            [  OK  ]
  Shutting down MySQL..                                      [  OK  ]
  Warning: Using a password on the command line interface can be insecure.
  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
  [root@autoinstallapi AutoInstall]#
  </code></pre>