MySQL command line autologin

You can put a file in your home directory called .my.cnf and put following content in it:

  • vi ~/.my.cnf
    • [mysql]
      user=username
      password=password
      
      [mysqldump]
      user=username
      password=password
      
  • chmod 600 ~/.my.cnf