19.5 忘記Admin密碼如何作

忘記Admin密碼如何作

  • 進入mysql命令行,選擇zabbix庫
  • mysql -uroot -p zabbix
  • update users set passwd=md5(‘newpasswd’) where alias=‘Admin’;
  • 這樣就更改了Admin用戶的密碼

忘記zabbix密碼

  • 有時由於時間長了,zabbix管理員帳號密碼給忘記了
  • 解決辦法:
    • 重置zabbix密碼,就是直接更改數據庫裏的數據便可
  1. 首先進入到mysql命令行裏面
A機器
[root@hf-01 ~]# mysql -uroot -phanfeng
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 342
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>
  1. 使用zabbix庫
mysql> 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
mysql>
  1. 查看zabbix相關的表,之後服務器監控的主機越多,那麼這些表會愈來愈大,因此須要去指定合適的監控策略
  • 好比說:數據量須要保存多長時間,那麼在定義這個監控項目的時候就該想到,要保留1個月仍是1年,仍是其餘時間;
  • 好比,監控的站點服務量很大的話,一天就要漲好幾個G,那麼你的服務器磁盤能支持保存多長時間;
show tables;
  1. zabbix的密碼,默認存放的表是users裏面
  2. 查看users表
  • desc users;
mysql> desc users;
+----------------+---------------------+------+-----+---------+-------+
| Field          | Type                | Null | Key | Default | Extra |
+----------------+---------------------+------+-----+---------+-------+
| userid         | bigint(20) unsigned | NO   | PRI | NULL    |       |
| alias          | varchar(100)        | NO   | UNI |         |       |
| name           | varchar(100)        | NO   |     |         |       |
| surname        | varchar(100)        | NO   |     |         |       |
| passwd         | char(32)            | NO   |     |         |       |
| url            | varchar(255)        | NO   |     |         |       |
| autologin      | int(11)             | NO   |     | 0       |       |
| autologout     | int(11)             | NO   |     | 900     |       |
| lang           | varchar(5)          | NO   |     | en_GB   |       |
| refresh        | int(11)             | NO   |     | 30      |       |
| type           | int(11)             | NO   |     | 1       |       |
| theme          | varchar(128)        | NO   |     | default |       |
| attempt_failed | int(11)             | NO   |     | 0       |       |
| attempt_ip     | varchar(39)         | NO   |     |         |       |
| attempt_clock  | int(11)             | NO   |     | 0       |       |
| rows_per_page  | int(11)             | NO   |     | 50      |       |
+----------------+---------------------+------+-----+---------+-------+
16 rows in set (0.01 sec)

mysql>
  • 須要修改的就是passwd的表
  1. 修改密碼
  • update users set passwd=md5(‘newpasswd’) where alias=‘Admin’;
mysql> update users set passwd=md5('aminglinux') where alias='Admin';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql>
  1. 查看錶的狀況
  • select * from users\G;
mysql> select * from users\G;
*************************** 1. row ***************************
        userid: 1
         alias: Admin
          name: Zabbix
       surname: Administrator
        passwd: 683cb8e76a8889fdc5161e3fa7e51f2d
           url: 
     autologin: 1
    autologout: 0
          lang: zh_CN
       refresh: 30
          type: 3
         theme: default
attempt_failed: 0
    attempt_ip: 
 attempt_clock: 0
 rows_per_page: 50
*************************** 2. row ***************************
        userid: 2
         alias: guest
          name: 
       surname: 
        passwd: d41d8cd98f00b204e9800998ecf8427e
           url: 
     autologin: 0
    autologout: 900
          lang: en_GB
       refresh: 30
          type: 1
         theme: default
attempt_failed: 0
    attempt_ip: 
 attempt_clock: 0
 rows_per_page: 50
2 rows in set (0.00 sec)

ERROR: 
No query specified

mysql>
  1. 修改之後就能夠去嘗試用新密碼登陸zabbix了,這就是充值zabbix管理員密碼
相關文章
相關標籤/搜索