找回密码
 注册
查看: 34|回复: 2

zabbix监控忘记admin登录密码解决方法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-2-8 17:01:40 | 显示全部楼层 |阅读模式
zabbix监控忘记admin登录密码解决方法6 R. T- Q* f' n( P6 F

/ g% O. P! Y% o# r# C# m+ B首先登录数据库
0 [+ k  X7 R# q- H) X
, J/ ?. z6 x6 v2 Z+ Z1 A( p[root@zabbix-server conf]# mysql -uzabbix -p4 T& ?* l3 Y- m+ f! r
mysql: [Warning] Using a password on the command line interface can be insecure.) }' O# s4 d# G: [8 u
Welcome to the MySQL monitor.  Commands end with ; or \g.3 G; Q7 @$ }4 w" z) L
Your MySQL connection id is 50
! v) r: G3 v8 Z" j0 V5 O* qServer version: 8.0.40 MySQL Community Server - GPL
) e0 |( }  n7 {$ t7 \+ {" D' N; t  \5 k6 [
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
- T: K( o+ t# y: e* K. t
  O2 B' P4 e  t+ t* gOracle is a registered trademark of Oracle Corporation and/or its
7 \+ P0 H1 p/ I4 Raffiliates. Other names may be trademarks of their respective
1 P* Q& Z; d# vowners.
$ H8 [* j4 c0 g/ }( P% L. z0 C" k, i& f' \5 ]/ N3 z5 t
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.$ a5 U' n, ]& V8 G* u1 n% L
) }$ e  j" y! ?2 P; v& B
mysql> show databases;
- z) ~# a2 j* b2 B( y7 j4 _2 }  o+--------------------+' ^2 K1 D' o5 w! r) t
| Database           |
$ r1 M# R( ?( q3 ]0 z& y3 t+--------------------+7 z7 E7 E* s9 ?. E2 }4 u
| information_schema |
/ ?' P) u. E% x8 `! N| performance_schema |! w- p3 J% T$ T7 W/ E
| zabbix             |
* G9 I0 j2 e' w& k) V& v0 \) p+--------------------+, Q& E: b) w4 h) D/ _
3 rows in set (0.01 sec)$ ?0 Z+ V# ~/ _
7 Q. N! r/ u: y5 r! I! L
mysql> use zabbix; m; U5 [( C7 @( ~
Reading table information for completion of table and column names
2 r7 m5 s; ~, B' R6 X/ K5 zYou can turn off this feature to get a quicker startup with -A
; L5 y: K$ u. u: H& \- }- v- n3 M- e5 n
Database changed& d3 _/ w6 N/ m1 g3 ~

$ f- A* t" I7 e" q( i4 p
/ T; N1 g4 I' F$ P( d/ w8 p$ q3 {  _4 l0 H$ g7 j! ?0 Z) v# R
mysql> select userid,username,name,passwd from users;7 w7 P2 f& d$ m4 m' M3 ]
+--------+----------+--------+--------------------------------------------------------------+
% r6 k* W2 a( [  M  J! v( Q6 B. H, C; d| userid | username | name   | passwd                                                       |
2 t* y7 C, k) H$ w( q+ ?+--------+----------+--------+--------------------------------------------------------------+% e% I2 h. r0 I' f  h
|      1 | Admin    | Zabbix | $2y$10$92nDno4n0Zm7Ej7Jfsz8WukBfgSS/U0QkIuu8WkJPihXBb2A1UrEK |& q. ?9 P  |6 W4 u
|      2 | guest    |        | $2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06 |% K" N2 W& C, i) i% j3 L  i# W
+--------+----------+--------+--------------------------------------------------------------+) B/ V' t. U) ]; L8 f+ H+ }% ^
2 rows in set (0.00 sec)- ?" h6 B% o4 _4 d' X7 m" z4 }

2 V: D& ^6 x; H# m$ T) Vmysql> update users set passwd=MD5('victors123') where username='admin';
1 i2 `! N: z0 S5 O/ iQuery OK, 0 rows affected (0.00 sec)
% F( p1 S, R5 c8 }3 X2 h& x% _Rows matched: 0  Changed: 0  Warnings: 0
! |" @7 r3 e5 z, X2 m2 |
$ h( i5 }1 x  O- f% k. w$ M. s' v: D7 ^- d' A5 v' n
: o- _. z3 Y7 ?! J7 e# i

0 ?, G( r' C7 i: Y. }/ r/ K* q

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2025-2-8 17:16:26 | 显示全部楼层
mysql> update users set passwd=MD5('victors123') where username='Admin';
5 Y) h! u" v% |Query OK, 1 row affected (0.00 sec)0 i6 j& A% V: l0 J0 L+ x6 P
Rows matched: 1  Changed: 1  Warnings: 0( n( a5 l1 V$ s/ o
) d+ ?' C) o- f5 ~0 B3 m6 J  E
mysql> flush privileges;' o9 _2 P0 p, R, y, r
Query OK, 0 rows affected (0.02 sec)0 J! _7 F' z4 {! q4 I) ~( P
! T# ?* C5 E; [$ L  _# k0 d
mysql> select userid,username,name,passwd from users;
) g0 o' A, j; ?3 T4 \0 u+--------+----------+--------+--------------------------------------------------------------+, ~# b2 d2 g. _, D
| userid | username | name   | passwd                                                       |- U- y  ]1 h% B& P/ _
+--------+----------+--------+--------------------------------------------------------------+
, s7 v3 c8 `+ ]" R/ P8 i|      1 | Admin    | Zabbix | f82d61a5bae93646df737371905f8d20                             |
8 b8 U. \/ I7 x  P. i|      2 | guest    |        | $2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06 |
( S- r+ e( ]- }* G: L& F* p+--------+----------+--------+--------------------------------------------------------------+
' P' Q1 |3 @  |8 A! q% e; b5 R) R; F2 rows in set (0.00 sec)' K  x( \' D4 O, D1 j

" ]% ^8 P3 v( N9 S

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2025-2-8 17:25:06 | 显示全部楼层
echo -n admin |openssl md5
6 F9 b" ~. ?5 D0 ^# W(stdin)= 21232f297a57a5a743894a0e4a801fc37 Z2 A3 Y, b2 q( _; q8 K

: f4 g5 t$ m# K, Jmysql> update users set passwd='21232f297a57a5a743894a0e4a801fc3' where userid='1';
. e  s+ f- \3 n" Q$ gQuery OK, 1 row affected (0.00 sec)
1 C+ F# [2 A  l- RRows matched: 1  Changed: 1  Warnings: 0
5 G* c0 e8 d" r  a( q4 d- ~# L  h+ A
% ~8 Y/ a& n, {8 _3 q6 Omysql> flush privileges;$ H$ x+ B& R7 ?- t9 ^
Query OK, 0 rows affected (0.02 sec)! I( ]3 q/ t( n6 e5 I1 M9 d

" k2 I. ^# b8 Q/ p8 K
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:48 , Processed in 0.013098 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表