zabbix 忘记admin密码

zabbix忘记admin密码

好长时间 没有使用admin登录zabbix了,尝试了几次没登录上去,虽然有其它用户 暂不影响使用,但问题一直在,也不是办法。通过数据库直接改密码字段。操作记录备忘。

解决方法

1.连接zabbix数据库

1
mysql -u root -p

2.查询user表信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7191
Server version: 5.5.64-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [zabbix]> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
| alerts |
|.......
+----------------------------+
140 rows in set (0.00 sec)

MariaDB [zabbix]> select userid,alias,passwd from users;
+--------+-------+----------------------------------+
| userid | alias | passwd |
+--------+-------+----------------------------------+
| 1 | Admin | fa062259ac376b119949f55de4f4c420|
| 2 | guest | fa062259ac376b119949f55de4f4c420|
| 4 | abc | fa062259ac376b119949f55de4f4c420|
+--------+-------+----------------------------------+
3 rows in set (0.00 sec)

MariaDB [zabbix]>

3.生成新的密码的md5信息

1
2
3
4
[abc@abc-pc ~]  echo -n lucky | openssl md5
(stdin)= 339a65e93299ad8d72c42b263aa23117

# luck为新的密码

4.update表数据,userid=1的这个用户

1
2
3
4
5
MariaDB [zabbix]> update users set passwd='339a65e93299ad8d72c42b263aa23117' where userid = '1';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [zabbix]>

5.刷新重新加载权限表

1
FLUSH PRIVILEGES;

zabbix 忘记admin密码
https://ywmy.xyz/2020/02/28/zabbix-忘记admin密码/
作者
ian
发布于
2020年2月28日
许可协议