linux admin 忘记密码,19.5 忘记Admin密码如何做

忘记Admin密码如何做

进入mysql命令行,选择zabbix库

mysql -uroot -p zabbix

update users set passwd=md5(‘newpasswd’) where alias=‘Admin’;

这样就更改了Admin用户的密码

忘记zabbix密码

有时因为时间长了,zabbix管理员账号密码给忘记了

解决办法:

重置zabbix密码,就是直接更改数据库里的数据即可

首先进入到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>

使用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>

查看zabbix相关的表,以后服务器监控的主机越多,那么这些表会越来越大,所以需要去指定合适的监控策略

比如说:数据量需要保存多长时间,那么在定义这个监控项目的时候就该想到,要保留1个月还是1年,还是其他时间;

比如,监控的站点服务量很大的话,一天就要涨好几个G,那么你的服务器磁盘能支持保存多长时间;

show tables;

zabbix的密码,默认存放的表是users里面

查看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的表

修改密码

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>

查看表的情况

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>

修改以后就可以去尝试用新密码登录zabbix了,这就是充值zabbix管理员密码

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值