Jump to content

Cannot reset mysql password


Go to solution Solved by yandoo,

Recommended Posts

Hiya jees I'm having a nightmare if you can help me please you'd be saving my life! 

 

I'm using wamp and phpmyadmin. I created a database and then decided to add a password to it in phpmyadmin by going to users > root > and copy and pasted my password in twice. As soon as it saved I was kicked out of phpmyadmin. Since then I have been trying to use command prompt to get access to the database but the passwors is not being accepted. 

 

So I tried resetting the password by creating a mysql-init.txt using the code "UPDATE mysql.user SET Password=PASSWORD('worldpeace') WHERE User='root';

FLUSH PRIVILEGES;"  Then I shut down mysql service and pathed in using "C:\wamp\bin\mysql\mysql5.5.24\bin mysqld --init-file=C:\\mysql-init.txt --console"  This doesn't work for me! It just hangs at the end and never restarts the service, which is when the password is suppose to be changed. Please see screenshot of command prompt. 

 

Ok so after this attempt I have tried to get in by: 

 

mysql -u root -h 127.0.0.1 -P 3306 -p

 

Enter password which I  leave blank

 

I then wanted to try and see the database so used show databases and was presented with ONLY the  information_scheme and test! Surely I can't have deleted the database!!??? OMG I'm gona get fired. 

 

Additionally i have tried: mysql.exe -u=root -p=admin. I get an error "Error 1045 (28000) :  Access denied for user '=root'@'localhost (using password: Yes) "

 

If anybody can please please help me get my password reset you ill be saving my life!

 

Thank you

 

 

p.s. please note i have just used mysql.exe -u=root -p

Enter password leave blank 

 

And from here I can show databases; and can see my database, so its not deleted! I just need to rest the password so I can get in. 

Edited by yandoo
Link to comment
https://forums.phpfreaks.com/topic/279366-cannot-reset-mysql-password/
Share on other sites

I've managed to enter the:

"UPDATE mysql.user SET Password=PASSWORD('worldpeace') WHERE User='root';"

"FLUSH PRIVILEGES;"

 

It says:

query ok 3 rows affected

query ok 0 rows affected

 

But when I try and access http://localhost/phpmyadmin/ I still cant get in! 

 

#1045 - Access denied for user 'root'@'localhost' (using password: NO) 

 

Oh man I'm screwed. Please help 

  • Solution

I've bloody done it!! Jees maybe Ill not be fired just yet then, hehe. 

 

If there is any one out there who has a similar problem here's what I did: 

 

cmd to correct directory: C:\wamp\bin\mysql\mysql5.5.24\bin

 

cmd command: mysql.exe -u=root -p

Enter password Leave blank hit enter

 

cmd command: UPDATE mysql.user SET Password=PASSWORD('mynewpassword') WHERE User='root';

cmd command: FLUSH PRIVILEGES;

Find config.inc.php in wamp \apps \phpmyadmin\config.inc.php

Edit file enter password in right section 

refresh wamp. 

 

pheeeew. I need a cigarette!  

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.