Forums / Customization from the Admin / Cannot reset admin password

Cannot reset admin password

Views: 6,608

Results 1 to 20 of 24
4 Oct 2011, 4:11 PM
#1
bishoptech avatar

bishoptech

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Cannot reset admin password

I have recently taken over a site for a new customer that is using Zen Cart. I am not very familiar with the product. The problem that i am having is that I cannot log into the admin portion of the site. I have followed all of the steps from this post http://www.zen-cart.com/forum/showthread.php?t=36258&highlight=reset+password+admin and still cannot log in as admin. I have been able to create a customer account, and I have run the SQL scripts for changing admin pw to Admin/admin. I have copied the pw hash from my new customer acct to the admin table and still cannot log in to the Admin account. Any help would be greatly appreciated.

4 Oct 2011, 6:06 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Cannot reset admin password

If it's telling you the password was rejected, then you've entered invalid username/password.
If it's just refreshing the page without any error message, then you've got a sessions problem you'll need to fix.

Can't help you much more without details about your setup. Please click Reply below and answer all the questions in the Posting Tips section.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Oct 2011, 9:22 PM
#3
bishoptech avatar

bishoptech

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Cannot reset admin password

The error message I get is "Error: Sorry, there is no match for that email address and/or password." but only when attempting to log in with an admin account. According to the version.php file I am using varsion 1.3.9. As I said earlier, I inherited this, and am not very familiar with Zen Cart (but it looks as though I will be getting familiar with it now) Thanks for your quick response.

4 Oct 2011, 9:33 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Cannot reset admin password

Okay, so that means you're actually not entering a valid username/password.

It could mean that your admin is pointing to a different database or table than where you did the SQL script reset.

Look in your /admin/includes/configure.php file for the DB_XXXXXXX settings.
Make sure you're doing your reset in the same database as DB_DATABASE and the "admin" table prefixed by whatever DB_PREFIX is set to. Possibly "zen_admin" instead of just "admin", if DB_PREFIX is set to "zen_".

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Oct 2011, 9:37 PM
#5
bishoptech avatar

bishoptech

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Cannot reset admin password

ok, a little more information on what I have tried. I have tried running the sql script to create the admin user account and have tried logging in with Admin/admin...No Go
I tried resetting the table and creating the Admin account again...No Go
I have checked the configure.php file in both relevant directories and the connection details match exactly...No Go
I tried creating a new user account and copying the hash for the known password on this account to the admin account in the DB...No Go
I have renamed the .htaccess file to .htaccess_bak for the root and the admin directories...No Go
I have tried the Forgot Password link to have the site email me a new password, I get the error "Error: The Email Address was not found in our records; please try again." ...No Go
It appears as though the admin folder, or table in the DB are not accessible for some reason that i cannot seem to track down.

4 Oct 2011, 9:39 PM
#6
bishoptech avatar

bishoptech

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Cannot reset admin password

DrByte:

Okay, so that means you're actually not entering a valid username/password.

It could mean that your admin is pointing to a different database or table than where you did the SQL script reset.

Look in your /admin/includes/configure.php file for the DB_XXXXXXX settings.
Make sure you're doing your reset in the same database as DB_DATABASE and the "admin" table prefixed by whatever DB_PREFIX is set to. Possibly "zen_admin" instead of just "admin", if DB_PREFIX is set to "zen_".

I have done all of this. There were 2 unused DBs in the account, but I have since deleted these so there is only 1 DB. the prefix is zen_ and I have taken this into account when running the SQL scripts.

4 Oct 2011, 10:34 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Cannot reset admin password

Do you always get the "sorry there was no match" error in EVERY case that you've tried that failed? Or only in "some" cases?

When did anyone last successfully login to the admin? Maybe this problem has existed for a long time with this particular site?

When you use the Forgot Password link, you need to supply an email address that matches the email address in the admin record in the database, else it'll give you the error message you quoted. There's no special hashing of the email address.

I'm guessing you're going to need to get down-and-dirty to figure out what's causing the code to not work the way it normally does out-of-the-box. http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Oct 2011, 11:49 PM
#8
bishoptech avatar

bishoptech

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Cannot reset admin password

I only get it when trying to log in with an admin account, and with nonexistent customer accounts.
I have no idea when the last time that someone logged in with admin successfully.
I use an account I create in the database with the hash for the password that should match "admin" from the sql code supplied on the forum post I used earlier.
That really sucks. I will look through the link and see if anything there applies. Thanks for your help.

5 Oct 2011, 1:18 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Cannot reset admin password

Just in case the forum post you were looking at contains invalid information, the official FAQ article should be considered more reliable:
https://www.zen-cart.com/tutorials/index.php?article=2

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Oct 2011, 1:53 PM
#10
bishoptech avatar

bishoptech

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Cannot reset admin password

that was the post that I originally started with.

5 Oct 2011, 2:35 PM
#11
bishoptech avatar

bishoptech

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Cannot reset admin password

one other thing. At the top of the site it has the error "Your database appears to need patching to a higher level. See Admin->Tools->Server Information to review patch levels." I cannot look into this of course because I cannot log in as admin. Does this help any?

5 Oct 2011, 6:53 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Cannot reset admin password

bishoptech:

one other thing. At the top of the site it has the error "Your database appears to need patching to a higher level. See Admin->Tools->Server Information to review patch levels." I cannot look into this of course because I cannot log in as admin. Does this help any?
Zen Cart consists of two pieces that must match: PHP files and Database data. If you upgrade PHP files and don't upgrade the database, or vice-versa, you'll get that sort of error message.
You'll sometimes get that message if you've been hacked and the hackers have damaged any of the files or database records involved in the version detection process.

So, since you're getting that message, it suggests you've got PHP files out of sync, which coincides with my suggestion to carefully inspect everything on your site to figure out what's different from the original files, and sort out whatever you discover.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Oct 2011, 9:58 PM
#13
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Cannot reset admin password

bishoptech:

I only get it when trying to log in with an admin account, and with nonexistent customer accounts.

You aren't perchance trying to login to admin, in the catalog section of the site where the customers login are you,?

Customers and admin have completely seperate login pages, in completely seperate parts of the site

your admin login page would be

yoursite.com/your_adminfoldeerrname/

--- had to explain this to someone for the umpteenth time a few days ago

Webzings Design
Semi retired from Web Design

10 Feb 2012, 12:11 AM
#14
danbro0811 avatar

danbro0811

New Zenner

Join Date:
Feb 2012
Posts:
6
Plugin Contributions:
0

Re: Cannot reset admin password

bishoptech:

that was the post that I originally started with.

I lost my Admin login password. So I clicked on "Resend Password" to get a new password. That was two days ago and I have still not received a new password. I have tried a few more times. Still no luck. I am positive my email address works because I have verified it from another address. So how can I retrieve a new password. Need to get into my Admin ASAP.

10 Feb 2012, 2:25 AM
#15
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Cannot reset admin password

danbro0811:

I lost my Admin login password. So I clicked on "Resend Password" to get a new password. That was two days ago and I have still not received a new password. I have tried a few more times. Still no luck. I am positive my email address works because I have verified it from another address. So how can I retrieve a new password. Need to get into my Admin ASAP.

https://www.zen-cart.com/tutorials/index.php?article=2

The best way to learn is to try stuff. But, back it up first.

10 Feb 2012, 5:06 PM
#16
danbro0811 avatar

danbro0811

New Zenner

Join Date:
Feb 2012
Posts:
6
Plugin Contributions:
0

Re: Cannot reset admin password

Yes, I've already been to that page, but it wasn't helpful. I'm not a tech guy, so all this stuff is pretty much Greek to me. My hosting company is Hostmonster, if that tells anyone what I'm dealing with. The Zen-Car tutorial says to "Open your phpMyAdmin (supplied by your hosting company), select your store's database, then click the "SQL" tab and run this query." OK, first of all, I see no option for "phpMyAdmin." There is one called php Config. However, when I go to that page, I see no SQL tab. So what do I do now?

10 Feb 2012, 7:06 PM
#17
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Cannot reset admin password

danbro0811:

Yes, I've already been to that page, but it wasn't helpful. I'm not a tech guy, so all this stuff is pretty much Greek to me. My hosting company is Hostmonster, if that tells anyone what I'm dealing with. The Zen-Car tutorial says to "Open your phpMyAdmin (supplied by your hosting company), select your store's database, then click the "SQL" tab and run this query." OK, first of all, I see no option for "phpMyAdmin." There is one called php Config. However, when I go to that page, I see no SQL tab. So what do I do now?

Log in to your cPanel, which is usually yourdomain.com/cpanel. Once in there, look in the section headed "Databases". There you will find phpMyAdmin.

The best way to learn is to try stuff. But, back it up first.

14 Feb 2012, 12:00 AM
#18
danbro0811 avatar

danbro0811

New Zenner

Join Date:
Feb 2012
Posts:
6
Plugin Contributions:
0

Re: Cannot reset admin password

OK, found that. Now here's the problem. I click on the tab "SQL" which opens the query window. Then I copy the query code into that window: FROM/INTO prefix_admin
DELETE FROM admin WHERE admin_name = 'Admin';
INSERT INTO admin (admin_name, admin_email, admin_pass, admin_level)
VALUES ('Admin', 'admin@localhost', '351683ea4e19efe34874b501fdbf9792:9b', 1);

I run the query, but then i get the following error message:

**Error
SQL query:
FROM / INTO prefix_admin DELETE FROM admin WHERE admin_name = 'Admin';
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM/INTO prefix_admin
DELETE FROM admin WHERE admin_name = 'Admin'' at line 1
**
Now what do I do? I also tried using the other code.

I appreciate you help.

14 Feb 2012, 1:58 AM
#19
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Cannot reset admin password

First, did you use the correct version of the patch? There are two; one for 1.39 and the other for 1.5. If you're sure you used the correct version then it's likely you pasted it in incorrectly. Make sure you didn't accidentally truncate it, and make sure you don't have extra spaces at the top or bottom. Use only a plain text editor to do the copy/paste.

PS: Also check to make sure you're not using table prefixes. If you are, you need to edit the patch to add the prefix.

The best way to learn is to try stuff. But, back it up first.

14 Feb 2012, 2:03 AM
#20
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Cannot reset admin password

Okay, I think I see the problem. You followed the instructions for databases that use a prefix by appending "prefix" to the table name. If you are using prefixes, the name would be whatever was assigned then the database was created, not "prefix". If you aren't using prefixes, just install the patch as written.

The best way to learn is to try stuff. But, back it up first.