Access denied for user

Hi
i got this error.i am using wamp server and i hav imported the database but still failed to access this page.please help me in this regard.

[COLOR=“Red”]Warning: mysql_query() [function.mysql-query]: Access denied for user ‘SYSTEM’@‘localhost’ (using password: NO) in C:\wamp\www\project\admin\login.php on line 17

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\project\admin\login.php on line 17[/COLOR]

You will need to specify the root password before you can run this command. If you do not know the root password then its better to reset it.

Stop MySQL server.
Search for my.cnf file in your MySQL installation folder and add skip-grant-tables under [mysqld].
Start MySQL Server.
Open command promot and cd to MySQL bin folder
Enter MYSQL prompt as mysql -u root
Execute the following command (Note: Replace YOUR_PASSWORD with your actual password.):

UPDATE user SET Password=PASSWORD(‘YOUR_PASSWORD’) WHERE Host=‘localhost’ AND User=‘root’;
Remote [B]skip-grant-tables[/B from my.cnf
Restart MySQL Server.

Then you will be able to login to MySQL as:

mysql -u root -p

or run mysqladmin command as:

mysqladmin -u root -p status

-p flag defines that the root password will be supplied so as you run any of these command, you will be asked to input root password.

Hi.

I am new to Mysql.
I am reading Build your own database driven website using php and mysql by Kevin Yank 4th edition.

My OS is Windows 7 Premium.

I am having following problem.
When I type “mysqladmin -u root status” on Command Prompt. I get following.

mysqladmin: connect to server at ‘localhost’ failed
error: 'Access denied for user ‘root’@‘localhost’ (using password: NO)

Please help me how to fix this problem. :slight_smile:

Are you supposed to login with user “SYSTEM” and without a password?

ok it is not recommendated settings but if you dont have much idea about these there must be a user called “root” with out any password (come with default wamp installation)
may be u can use that for now
and later may be u can change password of root or create a another user
just for now to move ahead may be you can use root …“” in your localhost testing

WAMP - Argh!

Oh, well, what you need is the good old GRANT command and a way to get it to your mysql server. Without a password for root, how does phpMyAdmin get installed and run? If WAMP doesn’t do that for you, UNINSTALL WAMP and do it right with the FREE Chapter 1 of Kevin Yank’s book - and REMEMBER your root password! From phpMyAdmin, you can then create your database, tables, etc and assign db access privileges via the GRANT command.

Regards,

DK