restoring password

hi ,

somebody hacked into my mysql database and changed my password to the mysql admin....
is there some way to retrieve it without loosing my whole database??

i have about a gigabite of information there which is backed up but without password i can't manage it....
when trying to access threw php admin the error message is "Access denied for user: 'root@localhost' (Using password: NO)"

Thanks for a quick answer

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

"(Using password: NO)"

If you do not provide a password the NO will appear. Was you previous password no password? If not then it did not make it to MySQL.

Anyway, to change your password kill all mysql processes so the server is not running, then start the server with the --skip-grant-tables directive to disable password checking. Then switch to the mysql database and issue:

UPDATE user SET password = PASSWORD('newpassword') WHERE user = 'root';

And you will have a new password for root.
funkytaz10Author Commented:
thanks for the answer....

i forgot to mention that this mysql database is used for a invision power board on a windows xp computer with MINI portal from instantservers as server...

so there is the big difficulty...


Is MySQL in your process list?
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

funkytaz10Author Commented:
yes... the forum is working but we can't change things any more...

That is not what I asked, if you go to the task manager and switch to your process list do you have a mysqld process listed?

Ok, first check this link so you get a understanding of how to do this:

Then since you are in windows right click on mysql service choose properties and stop the mysql service.
In the dialog box at the bottom, where it sais something like startup parameters, write in the following:
Start the service!

start a cmd shell, I assume mysql is installed in c:\mysql:
cd \mysql\bin
mysql -u root mysql
in the mysql prompt do this:
update user set password = password('mynewpassword') where user = 'root';

Now stop the mysql service, remove the startup parameters.
Start the service again.

Now you can login as root in your mysql database, this is the superuser and with this user you can change any other users password.
If the admin user you are talking about is a user a admin user for a bbs software, you need to consult the documentation for that software as how to reset such a
password, since that user is most likely not a mysql db user.

Now you should be able to login with your new password.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Does this restoring work also when root was deleted?
So by any chance any kind of user name?



I'm not sure, most likely it should be able to do this for any user.

Yeah, this is good for any user. Thanks!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.