Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

restoring password

Posted on 2003-10-29
9
Medium Priority
?
475 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
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

609 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