Page 1 of 1

Issue with password in MySQL

PostPosted: 21. August 2009 00:54
by lologirl
Ok, so back in March, I installed MySQL successfully, it was all working properly, it was all thanks to this Forum, and one lovely Australian user who had great patience with me and explained everything wonderfully.

So now I'm back for more help. I have been working on this all day and can't figure it out. My issue is that I have the MySQL password written down that I used. When I enter the password, I get the following;
Code: Select all
mysqladmin -u root -p status
Enter password: ******
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

First of all, does this mean that my password is not being accepted - i.e. - incorrect?

If so, then how can I reset the password, I can't figure it out and, as I say, I've been spending hours on this one issue at this stage.
Thanks in advance for any help or advice.

Re: Issue with password in MySQL

PostPosted: 21. August 2009 02:48
by Izzy
Thanks for the kind words and welcome back.

First make sure that you have started MySQL and it is showing green running in the XCP then try your command again.

If it still fails then you may need to reset the password by running C:\mysql\resetroot.bat file then if you wish and for security, create a new password for root using the Security link in http://localhost.

Then try your command again after once again checking that MySQL is running.

Good luck.

Re: Issue with password in MySQL

PostPosted: 21. August 2009 08:16
by aj123cd
hi
If you can, try it the following method. Pl let me know.
in phpmyadmin floder -> Open config.inc.php with a text editor.

fine line
$cfg['Servers'][$i]['password'] = 'YOUR PASSWORD';

WRITE IT DOWN U PASSWORD OR USER.
LET ME KNOW ISIT HELPFUL

* User for advanced features */

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'YOUR PASSWORD";

$cfg['Servers'][$i]['controluser'] = 'root';

$cfg['Servers'][$i]['controlpass'] = 'root';


/* Advanced phpMyAdmin features */


ref:http://community.apachefriends.org/f/viewtopic.php?f=16&t=36479

Re: Issue with password in MySQL

PostPosted: 21. August 2009 11:36
by lologirl
Izzy wrote:If it still fails then you may need to reset the password by running C:\mysql\resetroot.bat file then if you wish and for security, create a new password for root using the Security link in http://localhost.
Hi Izzy, I had already tried this as I found an old post of your advising the same, and it didn't work.
aj123cd wrote:If you can, try it the following method.
Thanks Aj123cd, I tried this - it isn't working, I am still getting the same error message. Can I ask you what changing cma to root does?

I had all this working fine before, I can't figure out what is going wrong.

Re: Issue with password in MySQL

PostPosted: 21. August 2009 12:03
by Izzy
What didn't work with the bat file - it didn't reset the password or it reset the password and the new password you created didn't help with your issue?

What version of XAMPP?

If I recall correctly you are using 1.7.0 which had a buggy resetroot.bat file.

Download this zipped patch from the XAMPP SourceForge Archive and extract the files to their respective folders including the resetroot.bat file and overwrite when asked.

Now try deleting your old password by running the bug fixed bat file.

You can then create your new root password using the method I pointed out above and then try your command again - with the new password it should work as I could replicate your error message quite easily.

Re: Issue with password in MySQL

PostPosted: 22. August 2009 17:21
by lologirl
Hey Izzy, thanks for this - I will try this tomorrow and post back to let you know, I don't have the time to do it right now.

Re: Issue with password in MySQL

PostPosted: 26. August 2009 12:50
by lologirl
Hi Izzy - your solution worked. :D Thanks a million for your help and sorry for talking so long to get back to you to let you know.

I have what is maybe a stupid question but I can't really understand this.
When I log in to MySQL using the password at the command prompt from the 'bin' directory like this:
mysql -h hostname -u username -p - I can log in successfully, and SHOW DATABASES shows information_schema and test and a list of other databases that I have created.
However from the same 'bin' directory, if I simply type mysql, then it looks like I am in MySQL SHOW DATABASES now shows simply information_schema and test, which were the databases already created when I installed MySQL. I just can't understand how I can get to these two databases without the password - is this standard, and why aren't they protected by the password?

Re: Issue with password in MySQL

PostPosted: 26. August 2009 13:08
by Wiedmann
I just can't understand how I can get to these two databases without the password -

Because you have an older XAMPP, which have an anonymous MySQL user. And this user have all privileges to the "test" db.

Regarding the "information_schema": Each user which can login, have access to this.