問題描述:
有時(shí)候忘記Zabbix admin的密碼了,因?yàn)橘~號太多
解決方案:
1、zabbix連接的是mysql數(shù)據(jù)庫
[root@localhost /]# mysql -uroot -pAbc123 #-u是用戶名,-p后面是密碼
2、進(jìn)入mysql數(shù)據(jù)庫以后查詢users表
MariaDB [mysql]> use zabbix;
MariaDB [zabbix]> show tables;
MariaDB [zabbix]> select * from users;
MariaDB [zabbix]> select userid,alias,passwd from users;
3、生成一個(gè)新密碼MD5,admin是密碼
[root@localhost ~]# echo -n admin | openssl md5
(stdin)= 21232f297a57a5a743894a0e4a801fc3
4、然后update表數(shù)據(jù),userid=1的這個(gè)用戶
MariaDB [zabbix]> update users set passwd=’21232f297a57a5a743894a0e4a801fc3′ where userid = ‘1’;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
5、刷新重新加載權(quán)限表
MariaDB [zabbix]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.03 sec)