title: Batch-file for mysqldump to backup each database into a separate file
body: <p>Trying to create a batch (cmd) file for backing up each database into a separate file.
  Databases are created/deleted often, so batch file needs to grab current db names everytime it runs and backup each one of them.</p>
  
  <p>Here is how I want it to be:</p>
  
  <pre><code>mysql -e "show databases" -u root --password=1234
  mysqldump %dbname% -u root --password=1234 &gt; S:\Backup\MySQL\%dbname%.sql
  </code></pre>
  
  <p>Is it possible to do in a batch file?</p>
  
  <p>Please help. Thanks.</p>