獲取heidisql保存的密碼
1.heidsql 默認保存的密碼忘記了,如何找回?
如下圖所示!
2.連接進入數據庫,導出配置文件。
3. 使用下列python代碼 運行
import re settings = r"D:\123.txt" #配置文件保存的位置 with open(settings,encoding="utf8") as f: lines = [r.strip() for r in f.readlines() if "\\Password<" in r] passwords = [re.split("\<\|\|\|\>",r)[-1] for r in lines] def heidipass(code): ascii = code[:-1] d = int(code [-1]) decode = lambda x:chr(int(x,16) - d) password = ''.join(map(decode,re.findall("\w{2}",ascii))) return password for r in passwords: print(heidipass(r))