Solved

restoring password

Posted on 2003-10-29
9
467 Views
Last Modified: 2008-03-17
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

Peter
0
Comment
Question by:funkytaz10
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 17

Expert Comment

by:Squeebee
Comment Utility
"(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';
FLUSH PRIVILEGES;

And you will have a new password for root.
0
 

Author Comment

by:funkytaz10
Comment Utility
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...

sorry

Peter
0
 
LVL 17

Expert Comment

by:Squeebee
Comment Utility
Is MySQL in your process list?
0
 

Author Comment

by:funkytaz10
Comment Utility
yes... the forum is working but we can't change things any more...

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 17

Expert Comment

by:Squeebee
Comment Utility
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?
0
 
LVL 8

Accepted Solution

by:
heskyttberg earned 250 total points
Comment Utility
Hi!

Ok, first check this link so you get a understanding of how to do this:
http://www.mysql.com/doc/en/Resetting_permissions.html

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:
--skip-grant-tables
Start the service!

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

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.

Regards
/Hasse

0
 

Expert Comment

by:MorganStanley
Comment Utility
Does this restoring work also when root was deleted?
So by any chance any kind of user name?

Regards,

Balázs
0
 
LVL 8

Expert Comment

by:heskyttberg
Comment Utility
Hi!

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

Regards
/Hasse
0
 

Expert Comment

by:MorganStanley
Comment Utility
Yeah, this is good for any user. Thanks!

B.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now