1

Got an Ubuntu 20.04 VirtualBox VM and after installing MySQL server, wanted to install MySQL Workbench.

I tried installing MySQL Workbench with APT first and ran:

sudo apt install mysql-workbench
sudo apt install mysql-workbench-community

Both commands resulted in:

E: Unable to locate package NAME_OF_THE_PACKAGE

According to this answer, I ran

sudo apt-add-repository universe

but when I do it, I get

'universe' distribution component is already enabled for all sources.

This saying, both that question and the one linked to that one didn't help fixing this problem.

If I go to Ubuntu Software and install from there Workbench, I'm able to but it gives a warning right away saying

Unsuported Operating System

You are running Workbench on an unsupported operating system. While it may work for you just fine, it wasn't designed to run on your platform. Please keep this in mind if you run into problems.

When trying to connect to localhost, I'm not able to even after as said in this answer (create a user called admin with a specific password and give it permissions) due to the following error

Cannot Connect to Database Server

Your connection attempt failed for user :

An AppArmor policy prevents this sender from sending this message to this recipient; ...

Note: there's a similar question but they use Snap Store.

1

The standard way for installing MySQL Community Workbench now is through snap.

Snap sets up AppArmor profiles for applications it installs, and it looks like when AppArmor denies access to certain files required by MySQL Workbench, the GUI just fails quietly. In your case with an AppArmor error, and in mine with no response at all.

There will be error messages pop up if you run dmesg or tail -f /var/log/syslog while Workbench crashes. Look for something like this:

audit: ... : apparmor="DENIED" operation="open" profile="snap.mysql-workbench-community.mysql-workbench-community" ...

In order to enable the access required, you'll want to enable Workbench to talk to your keyring:

snap connect mysql-workbench-community:password-manager-service

In my case, I also needed to allow Workbench to read my ssh keys because I was piping my connection over SSH:

snap connect mysql-workbench-community:ssh-keys
| improve this answer | |
  • 1
    The standard way for installing MySQL Community Workbench now is through snap: Citation needed. MySQL Workbench's snap isn't officially maintained by MySQL. – Kulfy Sep 2 at 8:18
0

To make it work I tested a different approach and went to MySQL Community Downloads.

In there, selected the operating system Ubuntu Linux, version 20.04 (x86, 64-bit) and clicked the Download button. Then, "No thanks, just start my download" and saved it. This is a .deb file that got saved in the Download folder and so, to install it,

cd home/tiago/Downloads

sudo apt-get install ./mysql-workbench-community_8.0.20-1ubuntu20.04_amd64.dev

After installation is complete, went to Applications, opened it and the AppArmor policy error didn't show up again but couldn't still connect using the root user.

Then, tying to connect with the credentials created in the approach two, it worked just fine

MySQL Workbench connected fine in Ubuntu 20.04

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.