N/APosted on - 09/03/2011
I know MySql provides 2 users access by default, such as root and localhost.
I am trying to access MySQL, but I receive an error.
Please tell me how I can access my database. Why do I receive this error ?
Thanks in advance.
Detail of Errors:
S1045 – Access denied for user ‘root’ @ ‘localhost’ (using password: No)
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
MySQL Access denied for user root and localhost
It seems that you missed to add '-p' parameter for the password. Or you are simply trying to login without a password.
Example: mysql -u root -p
Enter password: <password>
If you forgot your root password, save this query into a text file:
UPDATE mysql.user SET password=PASSWORD('newpassword')
WHERE User = 'root';
(The update statement updates the password. The flush statement informs MYSQL Server to reload the grant tables so it would recognize the password change.)
Make sure MySQL Server is stopped. Then run your query in the text file like this:
(Replace it with your correct directory)