Here is the simplest way to reset your joomla (3.x/4.x) password, if you have root access to the server (and database access):

 

  1. Log into your joomla server as root.

  2. Run the following command on the server:
    php -r "echo password_hash('my__new__password321', PASSWORD_BCRYPT) . PHP_EOL;"

    $2y$10$Vpi.NZOi95DB5vcxtbscNe06pK8nOm1xf1w/Qdtkuu.WfJohiDR/u
  3. Log into mysql (probably with the following command, unless your database is on another server):
    mysql -u root
  4. Find your joomla database:
    show databases;

    +--------------------+
    | Database           |
    +--------------------+
    | joomla1        | <-- here
    | information_schema |
  5. Switch to your database:
    use joomla1;
  6. Find your table prefix:

    show tables;

    +-------------------------------+
    | Tables_in_joomla1         |
    +-------------------------------+
    | qasdf_action_log_config       |
  7. Now that you know it's "qasdf" (or whatever), find your user:
    select username from qasdf_users\G

    *************************** 1. row ***************************
    username: admin
    1 row in set (0.00 sec)
  8. Update the password:
    update qasdf_users
    set password='$2y$10$Vpi.NZOi95DB5vcxtbscNe06pK8nOm1xf1w/Qdtkuu.WfJohiDR/u'
    where username='admin';


    Query OK, 1 row affected (0.00 sec)

    Rows matched: 1  Changed: 1  Warnings: 0
  9. You're done! Log in!