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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-2-8 17:01:40 | 显示全部楼层 |阅读模式
zabbix监控忘记admin登录密码解决方法$ O1 U0 Q- K' d1 w3 N# q
2 M8 O- i6 m$ i! c4 c! ~9 X: n
首先登录数据库
1 p/ {% G3 _! d$ m6 L9 u2 D+ r8 p
[root@zabbix-server conf]# mysql -uzabbix -p6 l4 M3 D, ~: J( @7 n1 i8 L- q
mysql: [Warning] Using a password on the command line interface can be insecure.& |# J! N# F' @0 |( l7 [
Welcome to the MySQL monitor.  Commands end with ; or \g.5 C; |. U) H: N5 W% @
Your MySQL connection id is 50
' W2 v3 V! e3 c1 z& K5 `Server version: 8.0.40 MySQL Community Server - GPL6 i9 E' j, O' G2 }5 K9 }

0 k1 s- k2 J" G& v# F8 |) tCopyright (c) 2000, 2024, Oracle and/or its affiliates.
  [8 e; b3 Z8 B) H  S0 d6 z8 u6 F1 ~% x" @1 z# Y( x
Oracle is a registered trademark of Oracle Corporation and/or its) V0 z2 J7 l  ~' a( G' Q& F/ x0 v. e
affiliates. Other names may be trademarks of their respective; H+ U" O& i) h5 @5 O+ @
owners.2 }9 c3 J- i1 w9 d% l$ k/ ~
$ l+ J- o' E5 j) W6 P
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
: t6 v" C( D9 [: c3 S! ?; e$ w; P! w* t1 g8 D" `7 i) T
mysql> show databases;
/ T  U' Y' z" a/ s: E% p: j+--------------------+
- U$ |; U9 }$ q| Database           |5 D8 p  v( L- t# |% G' _' u' h
+--------------------+! `9 n- h* x% f/ |" G
| information_schema |! [6 D) e( K. R, y; e! a4 M% z
| performance_schema |9 l8 ?9 D# C- h% @# |
| zabbix             |
+ _' Q6 _4 G' M& t1 j0 @5 L+--------------------+
8 M7 R: ?- B# b7 F8 H0 V3 rows in set (0.01 sec)
. w" R& U' Y9 |- p( P0 {: @' P1 ^7 A2 B& J- R  Z  K5 @" ]
mysql> use zabbix* Y7 Q- a9 M7 V1 w" u! i9 Q
Reading table information for completion of table and column names
( l* }2 K3 F7 k( A/ ]3 nYou can turn off this feature to get a quicker startup with -A" H. D6 G2 {& @# L5 h6 I6 G

- Z) j; A* V$ g2 b# E9 IDatabase changed
0 F) E' l( S5 z6 ^+ H5 E/ \
0 t/ j; q' U, I3 X6 k
: g8 I5 ?& G5 ]& o. H5 D8 `* M- w; G+ L' D: Y) ~( y
mysql> select userid,username,name,passwd from users;& x5 X2 b- b0 W! J
+--------+----------+--------+--------------------------------------------------------------+, ~0 |4 X% X9 W
| userid | username | name   | passwd                                                       |. p3 g6 h. A- ?( R$ u: y
+--------+----------+--------+--------------------------------------------------------------+
0 X( P6 g# r5 z2 s|      1 | Admin    | Zabbix | $2y$10$92nDno4n0Zm7Ej7Jfsz8WukBfgSS/U0QkIuu8WkJPihXBb2A1UrEK |. B1 W- b; a+ B& V+ L4 ]
|      2 | guest    |        | $2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06 |
2 \) U" Z* t% a5 E+--------+----------+--------+--------------------------------------------------------------+
% X& a$ R; u6 L5 g" [* t2 rows in set (0.00 sec)0 h2 e2 `8 V% f) N" \1 H
8 N5 P; ~* e; N' f* c
mysql> update users set passwd=MD5('victors123') where username='admin';/ q  {7 z; m* \* c; [# Q# D
Query OK, 0 rows affected (0.00 sec)
/ U/ N1 T# `/ |& x3 WRows matched: 0  Changed: 0  Warnings: 0
4 ~1 {+ [- O/ f5 A) d- A
$ X- w8 ~/ E8 C3 E$ m( N/ o7 Q% I0 f  ?6 A# \0 G0 c2 o& W

( w- ^1 Q$ D5 Q4 i+ L; @: I& ]: G' [
& j: i9 ?* L) [: u

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2025-2-8 17:16:26 | 显示全部楼层
mysql> update users set passwd=MD5('victors123') where username='Admin';7 g; M4 u7 w( m% Q
Query OK, 1 row affected (0.00 sec)
6 P% P( E3 U$ W$ iRows matched: 1  Changed: 1  Warnings: 00 F* O5 W' v" ^: X) y2 o
. {+ f- h3 M5 b6 y6 b
mysql> flush privileges;+ `5 q, C; [+ b1 w
Query OK, 0 rows affected (0.02 sec). a. x$ y# w! z2 Q* Z2 r( V

. h$ X" E( _. h* e% B$ Pmysql> select userid,username,name,passwd from users;3 g& b4 M  U# b& ]6 O
+--------+----------+--------+--------------------------------------------------------------+
; ^( i, O' P" T| userid | username | name   | passwd                                                       |
+ \1 N7 o* ~$ g( m+--------+----------+--------+--------------------------------------------------------------+
/ B6 e6 h# n( t" K|      1 | Admin    | Zabbix | f82d61a5bae93646df737371905f8d20                             |
6 Z5 t4 u3 N7 _. _|      2 | guest    |        | $2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06 |
% f; }1 }# E$ B* c+--------+----------+--------+--------------------------------------------------------------+
9 a' K* V' g2 C. w2 @2 rows in set (0.00 sec)
- `3 H9 P5 k' T  G7 L) _: C$ F
' e. V' x9 \& k% Z% M

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2025-2-8 17:25:06 | 显示全部楼层
echo -n admin |openssl md5
  F# n: s. a# R4 f; }/ U(stdin)= 21232f297a57a5a743894a0e4a801fc3  `* \* d2 r& P0 F, d0 {( d8 b9 E
. q" J2 X+ c) `9 x6 u3 U  n
mysql> update users set passwd='21232f297a57a5a743894a0e4a801fc3' where userid='1';' @0 J: w; x8 @) m
Query OK, 1 row affected (0.00 sec)
  E& |( F  m5 x3 TRows matched: 1  Changed: 1  Warnings: 0" q! j, d2 Y/ t' [" b

8 X# g5 u3 o& w* E0 H# Ymysql> flush privileges;
2 s% b$ D( d0 ]2 \Query OK, 0 rows affected (0.02 sec)
* H+ t: Z! r( }" H. X. Z) r
% ^! k8 F7 k2 s8 R  k; J
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:41 , Processed in 0.020251 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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