Skip to content

How to Reset Lost Mautic Administrator Password

If you have forgotten or lost your Mautic Administrator Password, or if after an update your login has stopped working. Mautic can send you an email with a link for you to create a new password.
But what if your email settings are missing or do not work propely anymore? Bad news, there is no way to recover it or change it from the UI.

However, if you have SSH access to your Mautic instance, you can directly modify the database, you won’t be able to see the stored password, but you can overwrite the existing password or even better, add a new user directly into the database here’s how:

TL;DR: Scroll down a bit for the Mautic 3 steps, scroll down a lot for the Mautic 4 steps:

I have found 3 interesting methods to solve the problem of a lost Mautic administrator password:

a) Create a new user with a new password.

b) Edit an existing user and overwrite the existing password.

c) The simplest method, use phpmyadmin or some other similar tool to edit the pertinent record.

Method “c)” is completely out of the scope of this little guide, so let’s focus on the other 2 methods.

The first method is preferred, because you do not modify an existing user (you do not destroy data), however, in practice, both will work just fine.

Since method “a)” requires you to insert a full new row into the Mautic database and I do not have the details of the full row for Mautic 4, let’s use it for Mautic 3, which is what I built this tutorial for in the first place, then I will present you with method “b)” and an example of how it can be used with Mautic 4.

If you do know the exact query for method “a)” to work on Mautic 4, please share!

Method a) Example for Mautic 3:

First log into your Mautic server or VPS with SSH.

Then log in to your MySQL console:

mysql -u root

List the databases on your server

MariaDB [(none)]> show databases;

You will get something similar to this:

+—————————–+
| Database
+—————————–+
| information_schema |
| mautic
| mysql      
| performance_schema |
+—————————–+
4 rows in set (0.01 sec)

Check the name of your database, probably “mautic”

Now select your Mautic database with

MariaDB [(none)]> use mautic;

The mysql console promt should change to:

MariaDB >

List all the users in your Mautic instance

MariaDB > select id, username from users;

Take note of the last listed user’s ID.

Now let’s add a new user and password, copy and paste the entirety of the following code in one take, but do not issue the command just yet!

MariaDB >

INSERT INTO `users` (`id`, `role_id`, `is_published`, `date_added`, `created_by`, `created_by_user`, `date_modified`, `modified_by`, `modified_by_user`, `checked_out`, `checked_out_by`, `checked_out_by_user`, `username`, `password`, `first_name`, `last_name`, `email`, `position`, `timezone`, `locale`, `last_login`, `last_active`, `online_status`, `preferences`)
VALUES (2, 1, 1, '2015-04-01 15:15:07', 1, 'Nobody', NULL, NULL, NULL, NULL, NULL, NULL, 'madmin', '$2y$13$VkE7UjFetqAM13oT4v/VYOfRCGrJ4hbr0zuwRZo6KVfDnNb16WFwy', 'Administrator', 'Uuser', 'user@local.host', NULL, NULL, NULL, NULL, NULL, 'offline', 'N;');

Before issuing the command (before you hit enter) Change the number 2 above (in bold) with the last ID you noted just before, plus 1.

Now list again all the users in your Mautic instance

MariaDB > select id, username from users;

A new user should have appeared at the end of the list, with name “madmin”

If so, you can now exit the MySQL console

MariaDB > exit;

You should now be able to login to your Mautic instance with:
User: madmin
Pass: madmin

Method b) Example for Mautic 4:

First log into your Mautic server or VPS with SSH.

Then log in to your MySQL console:

mysql -u root

List the databases on your server

MariaDB [(none)]> show databases;

You will get something similar to this:

+—————————–+
| Database
+—————————–+
| information_schema |
| mautic
| mysql      
| performance_schema |
+—————————–+
4 rows in set (0.01 sec)

Check the name of your database, probably “mautic”

Now select your Mautic database with

MariaDB [(none)]> use mautic;

The mysql console promt should change to:

MariaDB >

Now let’s edit the user with ID=1 and overwrite its password. We target the user with ID=1 because its the first user ever created wen you installed Mautic, if this is not your case or you are unsure, do not proceed or you will probably be overwriting someone else’s password.

To overwrite the existing password, copy and paste the following code on the MySQL command line:

MariaDB >

UPDATE users SET password = "$2y$13$VkE7UjFetqAM13oT4v/VYOfRCGrJ4hbr0zuwRZo6KVfDnNb16WFwy" WHERE id=1;

You can now exit the MySQL console with:

MariaDB > exit;

You should now be able to login to your Mautic instance with:
User: Administrator (Or whatever user you were using before)
Pass: madmin

Troubleshooting:

If you still can’t login, after completing these steps, try these other things:

  • Clear the Mautic cache
  • Reboot your Mautic server, container or VPS
  • Clear cache/cookies in your browser
  • Alternatively: Use PHPMyAdmin

If the command

mysql -u root

fails, try instead

mysql -u root -p

and then type your MySQL root password when prompted.

Conclusion:

Hope this Mautic tutorial was helpful to you, If it was, please say “Worked for me!” in the comments below.

If it didn’t work for you, ask any questions or post any trouble below and I’ll try to help you.

While you can’t recover your Mautic password unless you have a working email server on your VPS, you can overwrite it or create a new user, the simplest way is using some panel or UI, if that is also not a possibility, use one of those methods.
Both methods should work with any Mautic version, especially method “b)”, the examples shown here are just that, some examples…

NOTE: This guide is designed for Ubuntu using MariaDB with the MariaDB authentication plugin installed.

NOTE: Thank you Chad Windnagle: drmmr763/user.sql

NOTE: Thank you @hugronaphor

Yosu Cadilla

My name is Yosu Cadilla, a Systems Administrator since year 2000. I discovered Mautic on 2017 and since,
I’ve specialized in running Mautic for Marketing agencies and other large Mautic deployments.
Currently, I run a very specialized and fine-tuned cluster of Mautic-optimized servers called m.Runtime.

If you are planning on deploying Mautic on a large scale, let’s have a chat! yosu.cadilla@gmail.com

Thank you for reading this article, I hope you found it useful. If you have questions or comments, share them on the comments section below. I do my best to reply to every single comment.

wpChatIcon