How to retrieve saved MySQL Workbench passwords

I use MySQL Workbench a fair bit with Azure hosted MySQL databases. and various other MySQL servers. To make life easier I often save the passwords for non sensitive systems to the MySQL Workbench password vault.

I recently hit a problem when moving to a new laptop, I realised I didn’t have the password for a connection I needed.

In this post I will give you steps to retrieve all the saved passwords stored in the vault, just using PowerShell on the computer which holds the saved passwords.


Open PowerShell on the computer holding the password vault, logged on with the user that has the connections saved.

Run the below commands

Add-Type -AssemblyName System.Security

$cipher = Get-Content $env:APPDATA\MySQL\Workbench\workbench_user_data.dat -Encoding Byte

$scope = [System.Security.Cryptography.DataProtectionScope]::CurrentUser

$mysqlpwd = [System.Security.Cryptography.ProtectedData]::Unprotect($cipher, $null, $scope)

The result is you should get a list of all the saved connections, their username and passwords. The output is one joined up string per connection, so you will need to work out where the username starts and ents for example.

Last tested on Windows 11 February 2024

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.