0

enter image description here

I cannot open the local instance in MySQL Workbench in Ubuntu 20.04 after installing the MySQL server. I searched for some similar topics here but these did not help.

Solution Found: I've found the solutions for this problem. This was because of the MySQL Workbench couldn't store password in keychain and also because it failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES).

Use this command in the terminal: sudo snap connect mysql-workbench-community:password-manager-service :password-manager-service.

The snap package is sandboxed as usual and is not by default allowed to access the service. MySQLWorkbench is blocked by AppArmor when we choose "Store in keychain" option. That's why we need to enter the command to allow the package to access the service.

The solution links that helped me:

MySQL Workbench not saving passwords in keychain

Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES)

  • You can use this URL to fix that issue: https://blockdev.io/mysql-workbench-ubuntu-20-04-and-app-armor/ – zedfoxus May 14 '22 at 02:36

2 Answers2

0

Make sure all the mentioned things working.

First check mysql is running by running below command:

sudo systemctl status mysql

If it's running make sure that your mysql username is root and password you are entering is correct. If still not working make sure you have given all the privileges to user "root".

If don't know how to set privileges read this article carefully.

https://docs.rackspace.com/support/how-to/install-mysql-server-on-the-ubuntu-operating-system/

Zartash Zulfiqar
  • 93
  • 1
  • 3
  • 13
0

All I need to do here is mainly type the following command in the terminal:

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

Here, the snap package is sandboxed as usual and is not by default allowed to access the service. MySQLWorkbench is blocked by AppArmor when we choose "Store in keychain" option. That's why we need to enter the command to allow the package to access the service.

  • So, why does that work? – geertjanknapen May 27 '22 at 10:22
  • Because the snap package is sandboxed as usual and is not by default allowed to access the service. MySQLWorkbench is blocked by AppArmor when we choose "Store in keychain" option. That's why we need to enter the command to allow the package to access the service. – Aditya Datta May 28 '22 at 23:32