title: PHP MySQLi permission denied but working from MySQL CLI
body: <p>I'm receiving the error </p>
  
  <pre><code>Failed to connect to MySQL: Permission denied
  </code></pre>
  
  <p>When connecting from PHP with MySQL, MySQLi and PDO to a remote MySQL host.</p>
  
  <p>However, if I connect to the same host, with the same credentials through MySQL from the same host on the command line it works perfectly.</p>
  
  <p>So I'm making the assumption its a PHP config problem?</p>
  
  <p>Connecting FROM</p>
  
  <pre><code>PHP 5.6.40 (Client API version =&gt; mysqlnd 5.0.11-dev)
  
  MySQL 5.5.59
  </code></pre>
  
  <p>Connecting TO</p>
  
  <pre><code>PHP 5.6.23 (Client API version =&gt; mysqlnd 5.0.11-dev)
  
  MySQL 5.5.52
  </code></pre>
  
  <p>Anyone got any ideas why I can connect from the command line to MySQL but not from PHP to the same host with the exact same credentials?</p>