title: Integrating Mysql, Terminal, and a script
body: <p>I'd like to import a mysql dump created on my production server and copy it to a local database on a regular basis.  So far I understand how to perform the actions in Terminal on my Mac and how to create a bash script that I can call through either Terminal or Applescript; I'll  use Applescript to run the script which will be called through iCal on a daily basis. When I perform the operations in sequential order in the Terminal, the Terminal "knows" that I've connected to MySQL, as the prompt changes to a MySQL prompt after I type the first line:</p>
  
  <pre><code>/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot;
  DROP DATABASE `test_db`;
  </code></pre>
  
  <p>However, when I call the bash script with these commands, the second line is generating an error "test_db: command not found".  My guess is that in my script I'll need to somehow make it clear that the second line is specifically a MySQL operation.  Any help in achieving this would be appreciated.</p>
  
  <p>Thank you,</p>
  
  <p>Eric</p>