MySQL Workbench cannot store password, if you’re facing this error, I hope this post may help you to resolve the problem.
The environment where I encountered this error was my personal computer using Zorin OS 16.
You may also get this error if you are using Ubuntu Desktop from Focal version onwards.
The error MySQL Workbench cannot store password
Table of Contents
The error message look like:
Could not store password: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.327" (uid=1000 pid=14197 comm="/snap/mysql-workbench-community/9/usr/bin/mysql-wo" label="snap.mysql-workbench-community.mysql-workbench-community (enforce)") interface="org.freedesktop.Secret.Service" member="OpenSession" error name="(unset)" requested_reply="0" destination=":1.27" (uid=1000 pid=1738 comm="/usr/bin/gnome-keyring-daemon --daemonize --login " label="unconfined")
This error may happened when you try to store the database’s password with the button “Store in keychain”.
The message pop-up look like this.
Why does this error occur?
Normally, snap packages are usually in the sandbox. And these software packages will be prevented by AppArmor from accessing services on the operating system.
How to fix the error?
This is quite simple, you open Terminal on your computer and switch to sudo or root privileges.
And then you type the following 2 commands to allow MySQL Workbench to connect to the password management service.In fact, you only need the first command, and the second command will be used in case you use SSH to connect to the database.
snap connect mysql-workbench-community:password-manager-service
snap connect mysql-workbench-community:ssh-keys
And if you want to disconnect from MySQL Workbench to the above 2 services, you just need to run the following 2 commands.
snap disconnect mysql-workbench-community:password-manager-service
snap disconnect mysql-workbench-community:ssh-keys
Conclusion
With just a few simple commands, you can fix the error and get MySQL Workbench working again.