Dhruv Sehgal Dhruv Sehgal - 4 months ago 126
PHP Question

mysqli access denied for user on Hostinger

I know that This question is localized but it's urgent

I am getting



Warning: mysqli_connect(): (28000/1045): Access denied for user
'u386866041_dam'@'10.2.1.5' (using password: YES) in
/home/u386866041/public_html/ezCloudWebsite/dbconnect_app.php on line
2




error and this is my dbconnect_app.php


<?php
$con = mysqli_connect("mysql.hostinger.in","u386866041_dam","<Password>","u386866041_ez");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
exit();
}
?>


Please help.

Answer

Check is your user can login from this host. If not then you need to add a record for it in a users tab in phpMyAdmin.

Comments