title: Getting mysqldump: got error: 1045: access denied for user 'dev'@'localhost' (using password: YES) when deploying from capistrano task
body: <p>Just for context:</p>
  
  <p>I'm using Capistrano for deploying my WordPress site. specifically this one: <a href="https://github.com/markjquith/WP-Stack" rel="nofollow">https://github.com/markjquith/WP-Stack</a></p>
  
  <p>You basically install this on your dev machine, set up SSH on your local and remote machines so that it can access whatever it needs to access via the Capistrano, give it the database credentials used by the staging and production sites and you're good to go.</p>
  
  <p>deployment runs fine. syncing databases is where my problem is. specifically when the Capistrano runs the following code:</p>
  
  <p><code>mysqldump -u livesiteuser --result-file=/tmp/wpstack-26754.sql -h localhost -plivesiteuserpass livesitedbname</code></p>
  
  <p>which results in:</p>
  
  <p><code>mysqldump: Got error: 1045: Access denied for user 'livesiteuser'@'localhost' (using password: YES) when trying to connect</code></p>
  
  <p>BUT, when I run this same code myself on the remote server (where the production is at), it works.</p>
  
  <p>I'm really not sure what I'm doing wrong. I've made <code>livesiteuser</code> have grant access to everything. Oh yeah, using mysql <code>root</code> does the same thing.</p>