[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

restoring password

Posted on 2003-10-29
9
Medium Priority
?
476 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
ID: 9644166
"(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
ID: 9644453
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
ID: 9644497
Is MySQL in your process list?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

Author Comment

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

0
 
LVL 17

Expert Comment

by:Squeebee
ID: 9644758
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 750 total points
ID: 9657163
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
ID: 9897903
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
ID: 9904630
Hi!

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

Regards
/Hasse
0
 

Expert Comment

by:MorganStanley
ID: 9904655
Yeah, this is good for any user. Thanks!

B.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month19 days, 20 hours left to enroll

873 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