We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Reset website's admin account password through cpanel or phymyadmin

Medium Priority
475 Views
Last Modified: 2012-05-11
I am the sole administrator of a small website I had built for me a few months ago. I have full access to the cpanel and can view all the data in the database through phpmyadmin with no problem.

This website has one admin user registration, in a separate table from the other user registrations. Unfortunately I haven't logged into the site (as opposed to cpanel) for ages and I now cannot remember the password for this admin account. The specific reason I need to have this password is that there is a user interface with the admin account that means I can manage the site directly rather than through the database. I do not know what email address the web developer used to set up the admin account so I cannot have the password resent, and I cannot currently ask him.

Is there a way I can either reset the password for the admin account through cpanel or phpmyadmin, or add a new admin user with a password I select?

I have tried going in phpmyadmin to the table with the admin user in it, and inserting a new admin user with username admin2, password 'admin2password', setting the function of the password as MD5 and adding this new user, but going to the site and trying to log in with admin2/admin2password does not work.

Thanks in advance.
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Can you see the table that holds the old admin? Can you see any of the PHP code?

Normally you'd be able to query the table and see what email was used.. Also although I hope it isn't the admin account could be hardcode to row one or something silly..

Author

Commented:
I can see the table with this admin in it yes. It has one user in it, this admin user. It has a user ID of 1, a column called 's_email' which doesn't have an email address in it, it has the admin account name, and the password column which has a load of random characters in it (that I now think are SHA1 rather than MD5).

Can I query that table then? I don't know how to do that.
CERTIFIED EXPERT

Commented:
You could do the following

Change the id to 9
insert a new row id 1
try.
1 Empty password
2 password function phpmyadmin
3 Md5
4 sha1

Author

Commented:
I don't really understand what you mean after the first part. I have made the current admin id 9, added a new admin2 with id 1, with an empty password. I then tried to change the function to PASSWORD, then to MD5, and then to SHA1, and in each case tried to log into the site with an empty password field, but none of them has worked.

If that's what you meant for me to do it hasn't worked, if not I need it explained a bit better I think.
CERTIFIED EXPERT
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Aha! Yes!

That's worked with the test password and the function as SHA1 and it's let me in. I don't know what changing the ids did but that must have helped as I tried this before and it wasn't having it.

Thanks pnuts!
CERTIFIED EXPERT

Commented:
No problem .. The person who build it probably did sone hardcoding for whatever silly reason.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.