Issues connecting to mySql database on target machine <p>I'm using <code>hostgator</code> for hosting my website and I have added my <code>IP</code> address as remote access host. And then I connected with mySql workbench and tested the connection and I get the message that all parameters are correct. On <strong>hostgator</strong>, I added myself as a the admin user granting myself all privileges. Now I want to manipulate the database via a PHP script using PDO but this is the error I'm getting in my browser when I try to run the PHP file:</p> <p>Connection failed: <code>SQLSTATE[28000] [1045] Access denied for user 'user'@'host' (using password: YES)</code></p> <p>On mySQL workbench Users and Privileges tab, I get this:</p> <p>"<code>The account you are currently using does not have sufficient privileges to make changes to MySQL users and privileges.</code>"</p> <p>I'm not sure whats going wrong here and I'm quiet new to this. Can somebody please help?</p> <p>edit:</p> <p>php code below: </p> <pre><code>&lt;?php ini_set('display_errors',1); error_reporting(E_ALL); //this block tries to connect to the database //if there's an error connecting, the code under catch will //and the program will end $host="host"; $port="3306"; $user="xxx"; $password="xxx"; $dbname="database"; try { $conn = new PDO("mysql:host=$host;dbname=$dbname;", $user, $password); // set the PDO error mode to exception $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException $e) { echo "Connection failed: " . $e-&gt;getMessage(); } //$con-&gt;close(); ?&gt; </code></pre>