学习是一个逐步发现自己无知的过程!

ZAbbix忘记密码

忘记Zabbix密码找回

由于我安装时没记录密码、所以要修改密码。

登陆数据库

  [root@zabbix zabbix-server-mysql-3.4.14]# mysql -uroot -p

查看当前数据表

  MariaDB [(none)]> show databases;
  
  +--------------------+
  | Database           |
  +--------------------+
  | information_schema |
  | mysql              |
  | performance_schema |
  | test               |
  | zabbix             |
  +--------------------+
  5 rows in set (0.00 sec)

操作Zabbix数据库

  MariaDB [zabbix]> use zabbix;

数据库中的文件表

  MariaDB [zabbix]> show tables;

查看Users

  MariaDB [zabbix]> select * from users;
  
  +--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
  | userid | alias | name   | surname       | passwd                           | url | autologin | autologout | lang  | refresh | type | theme   | attempt_failed | attempt_ip | attempt_clock | rows_per_page |
  +--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
  |      1 | Admin | Zabbix | Administrator | 5fce1b3e34b520afeffb37ce08c7cd66 |     |         1 | 0          | en_GB | 30s     |    3 | default |              0 |            |             0 |            50 |
  |      2 | guest |        |               | d41d8cd98f00b204e9800998ecf8427e |     |         0 | 15m        | en_GB | 30s     |    1 | default |              0 |            |             0 |            50 |
  +--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
  2 rows in set (0.00 sec)

查看当前存在用户

  MariaDB [zabbix]>  select * from users\G;
  
  
  *************************** 1. row ***************************
          userid: 1
           alias: Admin
            name: Zabbix
         surname: Administrator
          passwd: 5fce1b3e34b520afeffb37ce08c7cd66
             url: 
       autologin: 1
      autologout: 0
            lang: en_GB
         refresh: 30s
            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: 15m
            lang: en_GB
         refresh: 30s
            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

修改表中内容md5默认就是zabbix的密码这里改为:zabbix

(意为将用户编号为1的用户的密码改为zabbix的md5值)

  MariaDB [zabbix]> update  users set passwd=md5("zabbix") where userid='1';
  
  Query OK, 0 rows affected (0.00 sec)
  Rows matched: 1  Changed: 0  Warnings: 0

更新权限

  MariaDB [zabbix]> flush privileges;

从web界面登陆

用户 Admin (你更改的用户) 密码 zabbix (你更改的密码)

赞(1)
未经允许不得转载:劉大帥 » ZAbbix忘记密码

你的评论可能会一针见血! 抢沙发

登录

找回密码

注册