Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1525
  • Last Modified:

How to Reset the Root Password MySQL 4.1

Hi Experts,
  We have lost the password for MySQL 4.1 for the root/sa user.

We are using MySQL front and trying to connect so we can create/UN/db.

How can you reset the password for MySQL 4.1 or if you install 4.1 will it overwrite the old information Databases and logins?

Also could we just upgrade to 5.0 and not lose any data either I will just be able to create a new login?

These links below seemed to work in the CMD but still won't let me login.

http://www.issociate.de/board/post/272629/root_password.html

This one seem to work and on the CMD promt it took like 3 sec and executed the command but the login didn't change.  I must be doing something wrong.  
http://dev.mysql.com/doc/refman/4.1/en/resetting-permissions.html
0
cybersharks1
Asked:
cybersharks1
  • 4
  • 3
1 Solution
 
todd_farmerCommented:
When connected to the database, issue:

SELECT COUNT(*) FROM mysql.user WHERE user='root' AND password = PASSWORD('pass');

where 'pass' is your actual new root password.  If the count is 0, it didn't get set correctly.  If the count is 1, you should be able to issue:

FLUSH PRIVILEGES;

and the connect using the root password.  If you are still unable to, please provide the error message when trying to connect.
0
 
cybersharks1Author Commented:
Hi Todd,
Thanks for replying, when I try and use the MySQL Command Instance, it prompts for a password.  If you type anything other than the password (which I dont know) It closes.  

What do you mean when connected to the Database?
I just log onto my Windows 2003 Server and Click Start/Mysql 4.1

Can I just reinstalled the program, will it keep the old DB and logins?
0
 
todd_farmerCommented:
It should keep the old DB and logins by default (though you will want to archive a copy of your data directory as a backup).  That won't resolve the problem, though, since the root account will also be retained (including the password that you are having issues with).

Try to connect by opening a command-line (Start->Run->cmd), then issuing:

mysql -uroot -ppass

(where pass is your password).
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
cybersharks1Author Commented:
Hi Todd,
I'm logged in as Administrator to the server.  Why do I not have access?

CMD
mysql -uroot -ppass

Error 1045 (28000) Access Denied for user root
0
 
todd_farmerCommented:
Probably because the password is wrong.  Did you create the file with the SQL statement and restart the server with the --init-file argument?  Are you using the same password that you specificed in the file?
0
 
cybersharks1Author Commented:
Ok, Todd thanks I forgot one of the last steps.  Thank you, I wrote this and printed it out if it happens again.  
0
 
todd_farmerCommented:
Glad to hear that solved it for you - thanks for the points!
0
 
Eclipse006Commented:
Question,

I have this same problem, however...

were am i ment to enter "SELECT COUNT(*) FROM mysql.user WHERE user='root' AND password = PASSWORD('pass');"

If the MySQL Command Line Client asks for the admin password
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now