By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

Recover a Password

P: n/a
Is there a way to recover a lost password in Mysql 4.1. I have seen many
articles and howto's on how to kill the Mysql process and then restart using
skip grant tables option. I am not trying to reset the password but rather
recover it. Resetting the password to something else would cause a problem
some of the underlying programs that rely on MySQL. I don't feel like
changing code for every application that is using MySQL in my site.

Also along similar lines. What if I were to kill the MySQL process and then
reload with the skip grant tables option and login to the MySQL server.
Could I create another account with root priviledges, such as admin, while
not messing with the original root account or it's password.

Lastly is there a way to copy just the grant tables information to another
copy of MySQL so that I can experiment with this process on a non production
box? Any help appreciated.

Running MySQL 4.1 PHP 4.3 Apache 2.0 on Redhat 9.0
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
chuy wrote:
Is there a way to recover a lost password in Mysql 4.1.
MySQL 4.1 passwords are encrypted using a one-way 41-bit hashing
function. Passwords are not reversible.
See http://dev.mysql.com/doc/mysql/en/password-hashing.html.
Resetting the password to something else would cause a problem
some of the underlying programs that rely on MySQL. I don't feel like
changing code for every application that is using MySQL in my site.
If there are programs that use the old password to log into the root
account, couldn't you recover the password by reading the code for those
programs? :-)
Could I create another account with root priviledges, such as admin, while
not messing with the original root account or it's password.
Yes, you could create another user with privileges to everything.
See example of creating superusers on
http://dev.mysql.com/doc/mysql/en/adding-users.html
Lastly is there a way to copy just the grant tables information to another
copy of MySQL so that I can experiment with this process on a non production
box? Any help appreciated.


AFAIK, you should be able to back up the mysql database just like any
other. Then restore it on your test system. I haven't done this
operation myself, though. So if there's some restriction against this,
I don't know.

Regards,
Bill K.
Jul 23 '05 #2

P: n/a
The password is located in an encrypted PHP script that is using ioncube for
dencryption. When I use the VI editor on the file I get a bunch of garbage.
Are you saying that is I am using Mysql 4.0 then I could get at the
password. To be sure I am unable to verify the actual version of MySQL
being used.

Upon further review I am inclined to say that 4.0 is being used as the PHP
version is onlyl 4.3 and the passwords seem to get passed on properly. On a
different server I use MySQL 4.1 with PHP 4.3 and no dice regarding
passwords unless I save password using old password line from within the
Mysql window.

In any event suppose I am using MySQL 4.0 or Mysql 4.1 with old passwords
would I then be able to recover them? Thanks

"Bill Karwin" <bi**@karwin.com> wrote in message
news:cu*********@enews4.newsguy.com...
chuy wrote:
Is there a way to recover a lost password in Mysql 4.1.


MySQL 4.1 passwords are encrypted using a one-way 41-bit hashing function.
Passwords are not reversible.
See http://dev.mysql.com/doc/mysql/en/password-hashing.html.
Resetting the password to something else would cause a problem some of
the underlying programs that rely on MySQL. I don't feel like changing
code for every application that is using MySQL in my site.


If there are programs that use the old password to log into the root
account, couldn't you recover the password by reading the code for those
programs? :-)
Could I create another account with root priviledges, such as admin,
while not messing with the original root account or it's password.


Yes, you could create another user with privileges to everything.
See example of creating superusers on
http://dev.mysql.com/doc/mysql/en/adding-users.html
Lastly is there a way to copy just the grant tables information to
another copy of MySQL so that I can experiment with this process on a non
production box? Any help appreciated.


AFAIK, you should be able to back up the mysql database just like any
other. Then restore it on your test system. I haven't done this
operation myself, though. So if there's some restriction against this, I
don't know.

Regards,
Bill K.

Jul 23 '05 #3

P: n/a
Upon further review the version is actually 3.23.58.
"chuy" <ch****@yahoo.com> wrote in message
news:11*************@corp.supernews.com...
Is there a way to recover a lost password in Mysql 4.1. I have seen many
articles and howto's on how to kill the Mysql process and then restart
using skip grant tables option. I am not trying to reset the password but
rather recover it. Resetting the password to something else would cause a
problem some of the underlying programs that rely on MySQL. I don't feel
like changing code for every application that is using MySQL in my site.

Also along similar lines. What if I were to kill the MySQL process and
then reload with the skip grant tables option and login to the MySQL
server. Could I create another account with root priviledges, such as
admin, while not messing with the original root account or it's password.

Lastly is there a way to copy just the grant tables information to another
copy of MySQL so that I can experiment with this process on a non
production box? Any help appreciated.

Running MySQL 4.1 PHP 4.3 Apache 2.0 on Redhat 9.0

Jul 23 '05 #4

P: n/a
chuy wrote:
In any event suppose I am using MySQL 4.0 or Mysql 4.1 with old passwords
would I then be able to recover them? Thanks


No. Passwords in earlier MySQL versions are still not reversible,
they're just encrypted with a shorter hashing function. You should read
the web pages I referred you to.

You're saying you have only the encrypted version of the PHP scripts,
and not the original source? I'd consider that a problem, for more
reasons than recovering the MySQL password.

Regards,
Bill K.
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.