• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 454
  • Last Modified:

Reset website's admin account password through cpanel or phymyadmin

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.
0
cidlockie
Asked:
cidlockie
  • 4
  • 3
1 Solution
 
p_nutsCommented:
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..
0
 
cidlockieAuthor 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.
0
 
p_nutsCommented:
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
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
cidlockieAuthor 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.
0
 
p_nutsCommented:
Ok I was suggesting to try first with an empty password

Then fill in password test and set the field to password in the edit form in phpmyadmin

Try again
Etc . So when encrypted use a password.

If that don't work you might want to check some of the code .. Also make sure all other fields are filled like the admin account.
0
 
cidlockieAuthor 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!
0
 
p_nutsCommented:
No problem .. The person who build it probably did sone hardcoding for whatever silly reason.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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