hallo to all web developers, I am having this problem. . .what does it mean? This happen everytime I put username and password on my sql database. . .Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'admin'@'localhost' (using password: YES) in C:\xampp\htdocs\sample\index.php on line 2
Access denied for user 'admin'@'localhost' (using password: YES)

Recommended Answers

All 3 Replies

Either the password you are using is wrong, or there is no permission for user 'admin' on local machine to access the database.

Check your username/password for the DB and also check the user has got the correct permissions.

Member Avatar for diafol

It may sound daft, but I spent a week, when starting out, trying to connect as 'admin' when I should have used 'root'.

Thank you for the help guys, solve at last. . .I use the root in the username and leave the password blank.

it looks like this:

$con = mysql_connect("localhost","root"," ");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.