网站的IP地址导致不同的网站

so i was connecting to my database using php's following code

$connect = mysqli_connect("websiteIP/domainName", "username", "password", "databasename");
if(!$connect){
   echo "Error: Unable to connect to MySQL." . PHP_EOL;
   echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
   echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
   exit;
}

and i got this error

Error: Unable to connect to MySQL.

Debugging errno: 1045

Debugging error: Access denied for user 'username'@'www.365casino.online' (using password: YES)

Now the real confusing past is www.365casino.online is not my domain but i don't know why is it showing and it is blocking me access to connect to my database.

P.S. i have checked and the issue is not of username or password or databasename.

So i found the answer myself, it's very simple just use localhost in place of your website Domain Name or IP address. like,

$connect = mysqli_connect("localhost", "username", "password", "databasename");