Skip to content Skip to sidebar Skip to footer

Access Denied For User 'root'@'localhost' (using Password: No)?unable To Authenticate Php/mysql?

I am getting following error: 'Access denied for user 'root'@'localhost' (using password: NO)?' Unable to authenticate php/Mysql I am getting this error using lamp server on u

Solution 1:

Solution 2:

You forgot to add password parameter into mysql_connect function, adding it as shown below should resolve your issue.

check this modification:

<?php$not_login = 0;
        if ($_SERVER["REQUEST_METHOD"] == "POST")
          {
        $servername = "localhost";
        $username = "root";
       $password = "";
        $con = mysql_connect($servername,$username, $password);

...

?>

Post a Comment for "Access Denied For User 'root'@'localhost' (using Password: No)?unable To Authenticate Php/mysql?"