SOLUTION FOUND:

I searched more generally and found this
http://www.devdaily.com/drupal/drupal-cant-login-after-upgrade-update

I tried it and it worked.

777 on the Sites directory and cleared all cookies from the browser.

Seemed to work.
--------------------------------

Tried several things now as outlined below.

Using the D7 user hash function, and copying the resulting string into PHPMyAdmin. Used the function in a .php file

To no avail.

Any other techniques? I can't really imagine anything as direct as the above...

Thanks,
JM

Comments

socceronly’s picture

My alter ego test user is also locked out, and the query to change that PW didn't work either.

rj’s picture

Have you tried resetting your password through /user/password?

--rj

socceronly’s picture

Yeah, neither account worked.

So the last thing I did before this happened was make a new user via the People > New User section of the site to test out some views magic.

Logged out to log in as the new user and ... poof... no more logging in.

:(

jaxxed’s picture

(EDIT: I'm a fool and didn't see that you'd already tried this)

There is a way to overwrite the password for any user if you have access to the database:

UPDATE users  SET pass = MD5('{new_password}') WHERE uid={user_uid};

So to overwrite the root user password with 'password' as the password

UPDATE users  SET pass = MD5('password') WHERE uid=1;

To overwrite someone who logs in with 'jaxxed' password with 'awesome':

UPDATE users  SET pass = MD5('awesome) WHERE name='jaxxed';

(please note that I typed these from memory without running them or checking the exact syntax.)

socceronly’s picture

Not a fool at all! Thanks for tryin to help!

jscoble’s picture

This method won't work for Drupal 7. Drupal 7 salts the password so just doing a straight MD5 of a password won't work.

In the users table, look at user for which you know the password. Then try to MD5 the plaintext version of the password, you'll see that its significantly different due to the salting.

For prior versions of Drupal, your suggestion is a good one.

socceronly’s picture

So I tried using this method

require_once 'includes/password.inc';
echo user_hash_password('mynewpassword');
die();

By posting it into the index file an copying the resulting string.

Pasted it directly into MySQL

This method was suggested here
http://drupal.org/node/992400

Still no go.

Getting odd.... :(

jscoble’s picture

You don't paste it directly into MySQL. That's for SQL and not php code.

The code you referenced is PHP and needs to be a .PHP file you run. The author suggests two options for doing so, though you can really name it anything you want as long as its extension is .php. And, as the post notes, make sure you either remove the file or remove the added code from the modified file, if you went this route.

socceronly’s picture

I did run it as a .php file. What I meant was I copied the resulting string, directly into the PW field in PHPMyAdmin. Then promptly removed the code.

Is there a difference between pasting in the string and running it as a query?

Thanks,
JM

jscoble’s picture

Sorry, I should have read more carefully.

I'm not sure what you mean by your question. The process described in that link worked just fine for me.

Either way, grats on getting your access back.

socceronly’s picture

I think it did work, what needed to be done was clear all cookies and for some reason change the permissions on the sites directory.