PHP访问被拒绝错误

I have a login script, PHP based. when I run the page I get the following error: Access denied for user 'usernameI'@'mydomainname.com' (using password: YES)

I've confirmed my password and that the respective user has all rights to the database. I tested a small connection script and get the same error. Here is the code:

<?php
$con = mysqli_connect("mydomainname.com","usernameI","mypassword");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?>

...I have the above within the body tag of the PHP page. Could I get some help as to what I'm doing wrong or if there is something I've overlooked or need to confirm? Thanks!