April 2021 Update:

From Percona Monitoring and Management 2.27,  the procedure is now simplified and it is possible by running:

 

default password pmm2If you’re automating Percona Monitoring and Management 2 (PMM) deployment with docker, you may want to set a different admin user password upon installation instead of being required to change it upon first login. Here is how you can do it.

After following the PMM2 Docker Installation Instructions, you can run this command:

Where “newpass” is your new desired password  and “pmm-server” is the container name you used to deploy PMM, you should see the following output indicating the password was changed successfully:

That’s it!

6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
MaximumG

Great tips to avoid using the default password for the whole system. Unfortunately when trying to use this command with an Ansible task, we are not indempotent anymore (The task is always executed for all playbook runs).

Is there a way to compare the password we want to apply before applying the docker exec command ?

Simon A

I have found this method is no longer reliable, and have had to resort to the sqlite method. It seems the new grafana update has made such things more difficult.

sqlite3 /srv/grafana/grafana.db

update user set password = ’59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6′, salt = ‘F3FAxVm33R’ where login = ‘admin’;

Sunni Kumar

Im trying to reset the password to a complex one with the help of this [blog|https://www.percona.com/blog/2020/01/15/changing-the-default-admin-password-in-docker-based-deployment-of-pmm2/.]

docker exec -t pmm-server bash -c 'ln -s /srv/grafana /usr/share/grafana/data; grafana-cli --homepath /usr/share/grafana admin reset-admin-password Li85dJ2e'

Then I did a restart, but it didn’t work.

But when use admin as the new password then it worked.

One more try:

Reset the admin password as admin, then if you login it’ll ask to change the default password, then I have a different password, it worked till that session. When I log out and try to login, its showing invalid password.

Another way:

Login with admin/admin, then go to dashboard –> click on the user avatar –> change password. After logout and login, again, invalid password.

lukelu

this method does not work now:
docker exec -it angry_edison /usr/bin/grafana-cli -homepath ‘/usr/share/grafana’ admin reset-admin-password ‘c8ZMmQiH0rF302gz’
INFO[01-05|02:28:47] Connecting to DB logger=sqlstore dbtype=sqlite3
INFO[01-05|02:28:47] Starting DB migrations logger=migrator
INFO[01-05|02:28:47] migrations completed logger=migrator performed=0 skipped=279 duration=1.525996ms

Admin password changed successfully ✔

then I go to log in with the new admin password it complains invalid username and password

Glyn Astill

Ooh Peter! I’m calling you out on having edited the page https://web.archive.org/web/20200226161348/https://www.percona.com/blog/2020/01/15/changing-the-default-admin-password-in-docker-based-deployment-of-pmm2/

It would seem after PMM 2.23 the old command stopped working, indeed the now updated command in the post works in PMM2.25.