PHP MySql Connect denied

Hi, I am running this simple test in PHP:

<?php $hostname=""; $username=<[i]my username[/i]>; $password=<[i]my password[/i]>; $database="movewithglenda"; $mysqli = new mysqli($hostname, $username, $password, $database, 3306); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } echo $mysqli->host_info . "\n"; echo "Connected"; ?>

The reply I get is :

Access denied for user ‘rchunt607’@‘’ (using password: YES)

Where is stutter coming from? I am able to connect with the same code and connection data on my localhost test server and with MySql Workbench.

I’ve been doing web database work with .NET and ColdFusion with MSSQL and Oracle for a long time but this is my first time with PHP and MySql. Any insights would be appreciated.


It looks like the MySQL user you’ve set up for this database only has access from one specific IP address (probably your home IP). You’ll need to grant it access from DreamHost systems as well ( to make it work from your hosting server.

Thank you so much. That was it.