Wednesday, October 7, 2015

Password retrieval from Heidi SQL


In case you forget your MySQL login then you can retrieve it in case you use Heidi SQL to connect with MySQL server and your password is stored in its settings.

You have to follow steps as listed below:
1. Go to File  ==> Export settings to dump all settings in a file
2. Open up the file in a text editor e.g. notepad
3. Look for your server name in the file
4. Your user name and password would be listed as 
  •  Servers\serverName\User<|||>1<|||>username
  •  Servers\serverName\Password<|||>1<|||>75453A3A7C7477695 
5. Now you have received your password but it is in encoded form and hence, can not be used directly. Use below mentioned JS to decode
function heidiDecode(hex) {
  var str = '';
  var shift = parseInt(hex.substr(-1));
  hex = hex.substr(0, hex.length - 1);
  for (var i = 0; i < hex.length; i += 2)
  str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
  return str;
}
document.write(heidiDecode('75453A3A7C7477695')); 
Just replace code in the last line of JS with your encoded password and run it in your browser console. You will get your password.