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:

That Answer Already Given Many Times Please refer Following Links.

Access denied for user 'root@localhost' (using password:NO)

'Access denied for user 'root'@'localhost' (using password: NO)'

https://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost

Php/Mysql login authentication

And If Can't Resolve the Issue then Go On This Link.

https://stackoverflow.com/help/duplicates

https://stackoverflow.com/help/how-to-ask


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?"