• 0

Resetting MySQL password?


Question

Running latest MySQL on an old XP machine.

I have looked everywhere, including MySQL's documentation. I get no error when I try to reset the MySQL password and I still can't reset the password.

I also logged in using mysqld.exe -u root --skip-grant-tables. I was able to get into mysql but even when I run

UPDATE user SET Password = PASSWORD('NEW_PASSWORD') WHERE User = 'root'; 

It says "Ok." But when I actually try to log in

mysql -u root -p

I still get an access denied error.

I tried uninstalling, I erased the whole MySQL folder even in C:\Program Files installation.

I try to install and it STILL has the password and I cannot find where the database is hiding so that I can delete it and build a fresh database with a new password since I don't have any important information.

I have installed it using all the default settings, tried googling for a quite a bit and I've run out of ideas.

Any help with this Neowin? Pretty please?

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

I was using PHPMyAdmin.

I wasn't using MySQL for a while. When I came back to use my testing server I tried all the passwords and they didn't work.

I tried logging in with PHPMyAdmin and Command Prompt box which is why I mentioned some of the commands I tried.

Link to comment
Share on other sites

  • 0

Did you set each service up individually or did you use a pre-packaged service (eg: xampp or wampp?)

Also have you.. just tried logging in without a password? I know you said you changed/reset/etc but just try nothing too :p

Link to comment
Share on other sites

  • 0

Pestering? Not at all, if anything I'd want to thank you for taking your time to looking into it! So thanks!

But yeah, Installing MySQL with default settings is easy. Just run exe and click on next all the way. I didn't need the manual for that.

The manual I'm talking about is resetting the mysql password, which is this one:

http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html#resetting-permissions-windows

Link to comment
Share on other sites

  • 0

Ah, I've never actually installed each service separately so didn't know MySQL's own was an easy installer! I AM LAZY and use the package installers, lol.

Try looking through regedit to see if there are any more MySQL entries hidden away that you didn't get when you uninstalled since we all know how pesky apps are these days. :3

Link to comment
Share on other sites

  • 0

phpmyadmin sometimes will deny root access. Look at the config.inc.php file for phpmyadmin and make sure that root is allowed to login in.

Also check that root is allowed to log in with the localhost domain/server

its possible that root is denied access when logged in via localhost

Link to comment
Share on other sites

  • 0

Err you need to change a MySQL database password or change root password for MySQL? I was assuming you needed root MySQL and not a database itself?

:3

Yes, I meant the root password. But I'm sure that's within the database that's created somewhere.

@ Milamber

I've logged in with MyPhpAdmin w/ root access and I didn't change anything so I don't see why.

Plus I logged in using Command prompt as well so it's not phpmyadmin.

Again, it worked fine logging in via localhost, the issue is just resetting the password since apparently I don't remember it =/

Link to comment
Share on other sites

  • 0

Yes, I meant the root password. But I'm sure that's within the database that's created somewhere.

@ Milamber

I've logged in with MyPhpAdmin w/ root access and I didn't change anything so I don't see why.

Plus I logged in using Command prompt as well so it's not phpmyadmin.

Again, it worked fine logging in via localhost, the issue is just resetting the password since apparently I don't remember it =/

My bad for misreading your post ;-)

1. Do a select * from user where username='root'; before and after and see if the password hash changes.

2. tried restarting the MySQL service?

3. There is a file you can create and get MySQL to run on startup to reset the password if you forget it, you could also try that as an option (google forgotten mysql root password)

Link to comment
Share on other sites

  • 0

Looks like you missed the part where I said that I've also done the file option, twice! :p (I mentioned I did the options in mysql manual and googled it like crazy)

Not only did I try restarting the MySQL service but I have also uninstalled it and the password won't go away when I install it again :(

Link to comment
Share on other sites

  • 0

Looks like you missed the part where I said that I've also done the file option, twice! :p (I mentioned I did the options in mysql manual and googled it like crazy)

Not only did I try restarting the MySQL service but I have also uninstalled it and the password won't go away when I install it again :(

Look for my.ini/my.cnf ;)

http://dev.mysql.com/doc/refman/5.1/en/windows-create-option-file.html

Link to comment
Share on other sites

  • 0

Thanks anyway Anthony, I appreciate it. But I got it. I just had to delete the folder in C:\Documents and Settings\All Users\Application Data\MySQL

Reinstalled and everything worked like reinstalling it like new!

Thanks again everyone.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.