最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

如何解決Navicat已經(jīng)成功連接,密碼忘記的問題

 更新時(shí)間:2024年07月17日 10:39:59   作者:自行車在路上  
這篇文章主要介紹了如何解決Navicat已經(jīng)成功連接,密碼忘記的問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

一直想寫一下這篇文章的總結(jié),因?yàn)橛袝r(shí)真的忘記了,要去網(wǎng)上重新搜索一下之前用過的方法,因此這里記錄一下,也為了以后遇到這種問題可以直接看我的文章,而不是到處找,以下為實(shí)踐篇。

1. 如果是win,通過注冊(cè)表里去找對(duì)應(yīng)的數(shù)據(jù),用php解碼

去cmd里輸入

regedit

去到對(duì)應(yīng)的注冊(cè)表

查找Navicat的密碼保存位置

去到對(duì)應(yīng)的路徑下面

計(jì)算機(jī)\HKEY_CURRENT_USER\Software\PremiumSoft

可以看到

打開對(duì)應(yīng)的目錄,尋找一下servers下要找的數(shù)據(jù)庫(kù),如我要找阿里云的密碼

尋找pwd找出來,復(fù)制數(shù)據(jù)

去到

https://tool.lu/coderunner/

復(fù)制黏貼一下php解密的代碼

<?php
namespace FatSmallTools;
class NavicatPassword
{
    protected $version = 0;
    protected $aesKey = 'libcckeylibcckey';
    protected $aesIv = 'libcciv libcciv ';
    protected $blowString = '3DC5CA39';
    protected $blowKey = null;
    protected $blowIv = null;
    public function __construct($version = 12)
    {
        $this->version = $version;
        $this->blowKey = sha1('3DC5CA39', true);
        $this->blowIv = hex2bin('d9c7c3c8870d64bd');
    }
    public function encrypt($string)
    {
        $result = FALSE;
        switch ($this->version) {
            case 11:
                $result = $this->encryptEleven($string);
                break;
            case 12:
                $result = $this->encryptTwelve($string);
                break;
            default:
                break;
        }
        return $result;
    }
    protected function encryptEleven($string)
    {
        $round = intval(floor(strlen($string) / 8));
        $leftLength = strlen($string) % 8;
        $result = '';
        $currentVector = $this->blowIv;
        for ($i = 0; $i < $round; $i++) {
            $temp = $this->encryptBlock($this->xorBytes(substr($string, 8 * $i, 8), $currentVector));
            $currentVector = $this->xorBytes($currentVector, $temp);
            $result .= $temp;
        }
        if ($leftLength) {
            $currentVector = $this->encryptBlock($currentVector);
            $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
        }

        return strtoupper(bin2hex($result));

    }

    protected function encryptBlock($block)
    {
        return openssl_encrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING); 
    }

    protected function decryptBlock($block)
    {
        return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING); 
    }

    protected function xorBytes($str1, $str2)
    {
        $result = '';
        for ($i = 0; $i < strlen($str1); $i++) {
            $result .= chr(ord($str1[$i]) ^ ord($str2[$i]));
        }
        return $result;
    }

    protected function encryptTwelve($string)
    {
        $result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
        return strtoupper(bin2hex($result));
    }
    
    public function decrypt($string)
    {
        $result = FALSE;
        switch ($this->version) {
            case 11:
                $result = $this->decryptEleven($string);
                break;
            case 12:
                $result = $this->decryptTwelve($string);
                break;
            default:
                break;
        }
        return $result;
    }
    
    protected function decryptEleven($upperString)
    {
        $string = hex2bin(strtolower($upperString));
        $round = intval(floor(strlen($string) / 8));
        $leftLength = strlen($string) % 8;
        $result = '';
        $currentVector = $this->blowIv;
        for ($i = 0; $i < $round; $i++) {
            $encryptedBlock = substr($string, 8 * $i, 8);
            $temp = $this->xorBytes($this->decryptBlock($encryptedBlock), $currentVector);
            $currentVector = $this->xorBytes($currentVector, $encryptedBlock);
            $result .= $temp;
        }
        if ($leftLength) {
            $currentVector = $this->encryptBlock($currentVector);
            $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
        }
        return $result;
    }

    

    protected function decryptTwelve($upperString)
    {
        $string = hex2bin(strtolower($upperString));
        return openssl_decrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
    }
}

 

use FatSmallTools\NavicatPassword;
 
//需要指定版本,11或12

//$navicatPassword = new NavicatPassword(12);

$navicatPassword = new NavicatPassword(11);

 

//解密
$decode = $navicatPassword->decrypt('15057D7BA390');
echo $decode."\n";

將15057D7BA390復(fù)制到倒數(shù)第二行

點(diǎn)擊執(zhí)行,得到密碼

2. linux/win/蘋果桌面情況下,可導(dǎo)出連接看然后去php解密(適用)

導(dǎo)出后用notepad++看里面的代碼

尋找password值

復(fù)制888B51B60B5FF32FAF86AC去第一種方法php方法里解密

3. 直接登錄navicat,用命令去改密碼

通過Navicat Premium能登陸MySQL,但root用戶密碼忘記了

方法: 用UPDATE直接編輯user表

mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';  mysql> FLUSH PRIVILEGES;

總結(jié)

  • 從操作上沒有卡手的地方
  • 不太明白為什么說php是最好的語(yǔ)言,猜測(cè)用java寫出來也是可以解密的

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

当雄县| 铁岭市| 香港| 阿拉善盟| 武定县| 涟水县| 鹤壁市| 郯城县| 康定县| 屯留县| 汨罗市| 陆良县| 永修县| 遵义县| 丹棱县| 永川市| 黄山市| 汝城县| 辽宁省| 乌拉特后旗| 德清县| 禹州市| 大同市| 梅河口市| 武山县| 永吉县| 高阳县| 永宁县| 宜宾县| 石林| 图木舒克市| 鲜城| 和平区| 永新县| 寿宁县| 安阳县| 宝丰县| 北流市| 龙泉市| 泰州市| 曲阳县|