Click here to Skip to main content
16,016,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i have made a login page for my website but when i test the login from the 'localhost' i get the message below:

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

can anyone help me with this error.

for your information, i have added my password to the file 'config.inc.php' by changing:

PHP
$cfg['Servers'][$i]['password']      = '';


TO

PHP
$cfg['Servers'][$i]['password']      = 'password';


Thank You for any help

Hamza
Posted

That error means that a webpage is accessing a server that has a password, but is not using one. root@localhost has a password and probably your mysql_connect() doesn't have a password parameter set up. Let's say you used:

$cfg['Servers'][$i]['password'] = 'password';

Your mysql_connect() should contain that password as well along with the proper parameters for ROOT@LOCALHOST

try this for instance:

mysql_connect("localhost","root","password");
 
Share this answer
 
Create a new user through phpMyAdmin and give it full privileges to the required database or for all databases. Then in config.inc.php write the username and password as you gave for new user.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900