Reset Mautic Password Using CLI

  1. Access your server (SSH or terminal): For local use ddev ssh
  2. Generate the hashed password: php bin/console security:hash-password Maut1cR0cks! 'Mautic\UserBundle\Entity\User'
    Replace Maut1cR0cks! with the password you want to set. This will output the hashed password.
  3. Copy the generated hash from the output of the previous command.
  4. Update the password in the database: php bin/console doctrine:query:sql "UPDATE mautic_users SET password = 'hashed_password' WHERE username = 'admin';"
    replace hashed_password with the hash you copied and replace admin with the username
  5. Clear the cache
  6. You can now log in to Mautic using the newly set password.
1 Like