Cloudera Manager 5.15.1忘記密碼怎么破?
作者:尹正傑
版權聲明:原創作品,謝絕轉載!否則將追究法律責任。
一.登陸CM修改默認密碼
1>.使用默認密碼登陸CM界面
2>.登陸數據庫,查看CM默認的密碼
[root@node101.yinzhengjie.org.cn ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 5.7.25-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, 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> mysql> use cdh 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> mysql> SELECT * FROM USERS where USER_NAME='admin'\G *************************** 1. row *************************** USER_ID: 1 USER_NAME: admin PASSWORD_HASH: 28050371a6c695ae410da08db8c26607ae2473fefa874016eab0cb72ca730fe4 #我們需要記住該字符串,因為我們在下面還得用到它喲~ PASSWORD_SALT: -4247944151022041411 #它我們也需要記住一下! PASSWORD_LOGIN: 1 OPTIMISTIC_LOCK_VERSION: 1 1 row in set (0.00 sec) mysql>
3>.點擊修改密碼
4>.自定義CM的登陸密碼
5>.使用之前默認的密碼登陸,發現無法正常登陸啦
二.觀察修改后數據庫存儲的字符串變化
1>.使用修改后的密碼進行登陸
2>.觀察此時數據庫存儲的用戶名密碼變化
[root@node101.yinzhengjie.org.cn ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 5.7.25-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, 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> mysql> use cdh 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> mysql> SELECT * FROM USERS where USER_NAME='admin'\G *************************** 1. row *************************** USER_ID: 1 USER_NAME: admin PASSWORD_HASH: 28050371a6c695ae410da08db8c26607ae2473fefa874016eab0cb72ca730fe4 PASSWORD_SALT: -4247944151022041411 PASSWORD_LOGIN: 1 OPTIMISTIC_LOCK_VERSION: 1 1 row in set (0.00 sec) mysql> mysql> mysql> mysql> SELECT * FROM USERS where USER_NAME='admin'\G *************************** 1. row *************************** USER_ID: 1 USER_NAME: admin PASSWORD_HASH: 250041eb472c23cf8c676c241439d8a7b99c2a3ea9df3cc37fb3eefd5ab43029 #發現沒有?它發生變化啦! PASSWORD_SALT: -6043720566682334983 #該值也發生變化啦~ PASSWORD_LOGIN: 1 OPTIMISTIC_LOCK_VERSION: 2 1 row in set (0.00 sec) mysql>
三.還原CM默認密碼
1>.還原CM默認登陸密碼
[root@node101.yinzhengjie.org.cn ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 5.7.25-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, 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> mysql> use cdh 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> mysql> SELECT * FROM USERS where USER_NAME='admin'\G *************************** 1. row *************************** USER_ID: 1 USER_NAME: admin PASSWORD_HASH: 250041eb472c23cf8c676c241439d8a7b99c2a3ea9df3cc37fb3eefd5ab43029 PASSWORD_SALT: -6043720566682334983 PASSWORD_LOGIN: 1 OPTIMISTIC_LOCK_VERSION: 2 1 row in set (0.00 sec) mysql> mysql> update USERS set PASSWORD_HASH='28050371a6c695ae410da08db8c26607ae2473fefa874016eab0cb72ca730fe4',PASSWORD_SALT='-4247944151022041411' WHERE USER_NAME='admin'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> mysql> SELECT * FROM USERS where USER_NAME='admin'\G *************************** 1. row *************************** USER_ID: 1 USER_NAME: admin PASSWORD_HASH: 28050371a6c695ae410da08db8c26607ae2473fefa874016eab0cb72ca730fe4 PASSWORD_SALT: -4247944151022041411 PASSWORD_LOGIN: 1 OPTIMISTIC_LOCK_VERSION: 2 1 row in set (0.00 sec) mysql>
2>.使用默認密碼進行登陸
3>.登陸成功