title: exec("mysqldump") returning 2 but the command works in command-line
body: <p>I'm trying to have MySQL backup through mysqldump and the command works in the command-line but it returns 2 from exec().</p>
  
  <p>Here's the code I'm using:</p>
  
  <pre><code>$filename = "/path/to/backup/dbBackUp".date("Y-m-d").".sql";
  $backupcmd = "/usr/bin/mysqldump -u USERNAME -pPASSWORD -A --single-transaction &gt;".$filename;
  exec($backupcmd, $output, $return);
  </code></pre>
  
  <p>Vardump of $output is array(0) { } and $return = 2.</p>