title: Can't connect to remote MySQL server (uses default server instead)
body: <p>I'm trying to connect to an AWS MySQL server from my VPS, but no matter what I try, I just get access denied, my user has privileges to connect from any host.</p>
  
  <p>If I try to connect via PHP:</p>
  
  <pre><code>$db = new mysqli('mysite.cufncdsjslka.us-east-1.rds.amazonaws.com', 'my_user', 'my_pass', 'my_db');
  </code></pre>
  
  <p>Gives me: <code>Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'my_user'@'XXXX.myhost.com' (using password: YES) in /home/me/shopify/libraries/db.lib.php on line 4</code></p>
  
  <p>If I try to connect via the MySQL CLI:</p>
  
  <pre><code>mysql -h mysite.cufncdsjslka.us-east-1.rds.amazonaws.com -umy_user -p
  </code></pre>
  
  <p>Gives me: <code>
  ERROR 1045 (28000): Access denied for user 'my_user'@'xxxx.myhost.com' (using password: YES)</code></p>
  
  <p>This command works flawlessly on my PC, but not on my VPS.</p>
  
  <p>I'm assuming it's some sort of security setting preventing MySQL from using external servers?</p>
  
  <p>My VPS is running Debian squeeze with the LAMP components all from the standard Debian packages except for PHP which I manually updated to 5.4.</p>
  
  <p>I'm posting this as a new question since most similar questions I've found on SO were a permissions issue (I've given my MySQL user priveliges to connect from any host) or a SELinux issue (which AFAIK doesn't apply to Debian)</p>