Guys I was playing around with the Views module making user list's. I got the user list to work, but it duplicated my only account on the display page. It was displaying about 10 copies of the same (and only) user on the list. I clicked delete on one of them and it deleted the only admin account. I thought this was impossible to do, but the module did it and now I am unable to log back in. Password recovery does not work nor does it even recognize the username that my admin account was...

What can I do? I have put many hours into this site and don't want to have to reinstall everything. Can I go into the database tables somehow and do this?

Comments

vm’s picture

This would explain the best practice of why you shouldn't be "testing" ideas on your production environment. Beyond that you should be doing regular DB backups before manipulating anything.

In future please tag your thread with the version of drupal in use. At the very least mention the version in use.

your answer lies here in the trouble shooting FAQ's section: http://drupal.org/node/186256

wposey’s picture

Of course to make my problem more complicated, I have the user registration disabled. So I go down to the option for this and copy/paste

UPDATE variable SET value = 's:1:"1";' WHERE name = 'user_register';
DELETE FROM cache WHERE cid = 'variables';

into the SQL (query?) tab of phpmyadmin and it says it is executed correctly? But I do not see the option appear on my home page to create a new user account... what am I missing?

vm’s picture

I certainly hope you are backing up your database before running SQL code in php.

BACK UP NOW!
then use the following in the SQL tab of phpmyadmin

INSERT INTO users (uid, name, pass, status) VALUES ('1', 'yourname', md5('yourpassword'), '1');

The above should create a new admin user and set the status of that user to active. go to your profile to add any missing information.
If you were posting as the first created user, it is possible your posts have become disassociated with your user.