Skip to content

Commit e4cb368

Browse files
committed
Update grafana_admin_password section
Updating the procedure instead of adding a note
1 parent 4e023a9 commit e4cb368

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

doc/source/operations/secret-rotation.rst

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -222,39 +222,32 @@ Full method
222222
223223
2. Update the value of ``grafana_admin_password`` in ``passwords.yml``
224224

225-
3. Exec into the Grafana container on a controller
225+
3. Exec into the MariaDB container on a controller then login to MariaDB
226226

227227
.. code:: bash
228228
229-
sudo docker exec -it grafana bash
230-
231-
4. Run the password reset command, then enter the new password
232-
233-
.. code:: bash
229+
sudo docker exec -u 0 -it mariadb bash
230+
(mariadb) mysql grafana -p
231+
# Enter database password when prompted
234232
235-
grafana-cli admin reset-admin-password --password-from-stdin
233+
4. Query for the ID of ``grafana_local_admin``
236234

237-
.. note::
235+
.. code:: sql
238236
239-
If you see an error ``Error: ✗ could not read user from database. Error: user not found``
240-
from Grafana CLI, it means that the ID of ``grafana_local_admin``
241-
is not 1 (The default value used with password reset command).
242-
You can find the ID of ``grafana_local_admin`` by accessing MariaDB.
237+
SELECT id,login FROM user WHERE login = "grafana_local_admin";
238+
# Take a note of this ID
243239
244-
.. code:: sql
240+
5. Exec into the Grafana container on a controller
245241

246-
# Enter MariaDB with
247-
docker exec -u 0 -it mariadb bash
248-
mysql grafana -p
249-
# Enter database password when prompted
242+
.. code:: bash
250243
251-
SELECT id,login FROM user WHERE login = "grafana_local_admin";
244+
sudo docker exec -it grafana bash
252245
253-
Once you get the ID, run the password reset with user-id option
246+
6. Run the password reset command, then enter the new password
254247

255-
.. code:: bash
248+
.. code:: bash
256249
257-
grafana-cli admin reset-admin-password --user-id <id> --password-from-stdin
250+
grafana-cli admin reset-admin-password --user-id <id> --password-from-stdin
258251
259252
12. Update the MariaDB database password
260253

0 commit comments

Comments
 (0)