views:

34

answers:

4

I have set up an Apache server on mandriva linux 2010.1. But the problem is whenever I'm trying to connect with the database, it's giving me the following error:

Error:Database error: SQLSTATE[28000] [1045] Access denied for user 'root'@'myhostname' (using password: YES)

Can anyone help in this regard please?

Thanks.

A: 

you need to set some configuration variables for phpmyadmin to work: http://www.phpmyadmin.net/documentation/Documentation.html#config

Mike Sherov
+1  A: 

Normally for a web application, you shouldn't connect to the database as root. However you tagged your post as [phpmyadmin] so I assume your issue is with, well, phpMyAdmin, in which case you might be connecting as root.

If this is the case, I see that you mentioned myhostname in your error message. Have you tried connecting to localhost instead? Sometimes the MySQL root user cannot connect from remote hosts.

Josh
Thanks.. That really helped :)
eishita
I'm glad I could be of assistance!
Josh
A: 
GRANT ALL PRIVILEGES ON *.* TO monty@localhost
       IDENTIFIED BY 'indian' WITH GRANT OPTION;

Replace your username and password and execute it in your phpmyadmin by selecting your database.

Vinothbabu
A: 

Take a look at "5.4.7. Causes of Access-Denied Errors" in the MySQL online documentation and Using authentication modes" in the PHPMyAdmin documentation.

VolkerK