Forums

[resolved] login trauma - users have vanished from PHP database (6 posts)

  1. sparkletack
    Member
    Posted 3 years ago #

    As of yesterday, I can't login to WP

    WP tells me that my username doesn't exist, but worse, that user "admin" is not a valid username.

    I've tried the "emergency.php" trick, and gone into MySQL to edit the password, but there are no usernames registered in the database, thus no passwords to change.

    The fixes I've found online all involve changing a password, not re-adding a username.

    How to resolve this?

    A screenshot of my MySQL setup is here:
    http://www.santacruzharley.com/ad_images/schd_php.png

  2. whooami
    Member
    Posted 3 years ago #

    you need to readd the admin user, than. You can do that within phpmyadmin. Though, its a little tricky with the secret keys, and the salting stuff.

    Ill explain the best way to do this when I come back after getting to work.

  3. whooami
    Member
    Posted 3 years ago #

    ok. the simplest way to repopulate that data is to install wordpress again, in another directory on your site, using another table prefix

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!

    Make sure that you use the same wordpress version as the other one, and that the keys in the wp-config.php match (i dont know that that would make a diff. were it not, but better safe than sorry).

    After youve done that, you can delete the actual wordpress files from that new install, and go into your database and copy the row for that new installs into the old, empty users table. Then you can delete all those newly created tables.

  4. sparkletack
    Member
    Posted 3 years ago #

    Thanks Whooami ... I'm gonna give it a shot.

  5. whooami
    Member
    Posted 3 years ago #

    awesome.

    One thing that might simplify this for you, that you can do if youre familiar with using phpmyadmin..

    once you have the tables from the new install -- delete the old empty wp_users table (or whatever youre using) and just rename the new table (wpnew_users or whatever you are using) to the old one.

  6. sparkletack
    Member
    Posted 3 years ago #

    Success!

    Wipin' the sweat from my brow with relief. :)

Topic Closed

This topic has been closed to new replies.

About this Topic