Dear all.

I am unable to access my own WordPress admin page. When I use my username/email in the "forgot my password" link, nothing comes to my registered email. I tried using the logs to use the original password but it didn't work (maybe I changed it?). None of the passwords in my Keychain access worked either. I am totally locked out.

So I thought maybe I create another database user, and with that user I just re-write the admin password in the MySQL database but have no idea how to do it in MariaDB as it did not recognize my website when I logged in.

Any tips?

  • fa8d replied to this.

    fa8d

    OK this is weird but I just figured this out. I am writing the solution for the record.

    The reason it did not send a recovery password to my email is that my default email is set to you@example.com. To fix this, we need the original admin database account. You go to the logs, and type the name of the website/server you want to search and then go to the first record

    The default password for MariaDB user {} is []

    And use these credentials to log in to the MariaDB. When you do, go to "wp_users" table and edit the email.

    Of course, you should know what you are doing here.

      fa8d Glad you were able to sort this out! If you run into this type of problem in the future then I recommend using the WP-CLI tool to update your user info, eg:

      cd ~/apps/name_of_app
      wp user list | grep your_username
      # make a note of the user ID from the previous command (123 in the example below), then...
      wp user update 123 --user_email=you@domain.com --user_pass=your_new_password
      Mastodon