前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >19.5 忘记Admin密码如何做

19.5 忘记Admin密码如何做

作者头像
运维小白
发布2018-02-07 11:25:28
7840
发布2018-02-07 11:25:28
举报
文章被收录于专栏:运维小白运维小白运维小白

忘记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管理员密码
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 忘记Admin密码如何做
  • 忘记zabbix密码
相关产品与服务
云数据库 MySQL
腾讯云数据库 MySQL(TencentDB for MySQL)为用户提供安全可靠,性能卓越、易于维护的企业级云数据库服务。其具备6大企业级特性,包括企业级定制内核、企业级高可用、企业级高可靠、企业级安全、企业级扩展以及企业级智能运维。通过使用腾讯云数据库 MySQL,可实现分钟级别的数据库部署、弹性扩展以及全自动化的运维管理,不仅经济实惠,而且稳定可靠,易于运维。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档