43

Using Kubuntu 16.10, I'm saving a password into the keyring in MySQL Workbench, checking the "Store password in keychain" checkbox.

It works as long as it's open (doesn't ask for password), but when I re-open the program it prompts for the password again.

Not many people seem to have this problem. It might have something to do with my OS, but I'm not sure.

JoseHdez_2
  • 4,040
  • 6
  • 27
  • 44

8 Answers8

89

I am using Ubuntu 18.04. Here is a the error I'm seeing:

pic of the error

Solution

  1. Go to Ubuntu software center.
  2. Search for MySQL workbench community.
  3. Click on permission
  4. Enable Read, add .... to on
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Martín Mori
  • 1,021
  • 1
  • 7
  • 5
69

If you have downloaded Mysql-workbench using snap then You need to enter a command to allow this package to access the service. The command is:

sudo snap connect mysql-workbench-community:password-manager-service :password-manager-service
Gagan Parmar
  • 791
  • 6
  • 9
33

(It's OK to Ask and Answer Your Own Questions)

If this happens to you, try installing gnome-keyring if you don't have it.

sudo apt-get install gnome-keyring

Solved the problem for me.

JoseHdez_2
  • 4,040
  • 6
  • 27
  • 44
  • 1
    Worked like a charm! Solved the issue on Arch Linux version 4.18.3. Thank you! – Sebastian Kaczmarek Aug 20 '18 at 11:57
  • or on mac: brew install gnome-keyring – user2568374 Mar 17 '20 at 14:42
  • but then I got Error: No available formula with the name "gnome-keyring" ==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run: git -C "$(brew --repo homebrew/core)" fetch --unshallow Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps. – user2568374 Mar 17 '20 at 14:52
5

enter image description here

During the Mysql installation via Ubuntu Software center it gives all the necessary instructions for this as in the screenshot.

So all you need:

  • snap connect mysql-workbench-community:password-manager-service
  • snap connect mysql-workbench-community:ssh-keys
Sampath
  • 119
  • 1
  • 4
2

Okey, I was facing same issue and that was really really annoying, so here is my workaround / fix :

I'm on Debian 8 Jessie with Gnome 3.14.1

Somebody was talking about this issue, but his fix wasn't fully working for me : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769393

SOLUTION :

Create this new script file :

/usr/local/bin/mysql-workbench

with following content :

#!/bin/sh
if [ -n "${XDG_RUNTIME_DIR}" ]; then
  GNOME_KEYRING_CONTROL="${XDG_RUNTIME_DIR}/keyring/control"
  [ -z "${GNOME_KEYRING_CONTROL}" ] || export GNOME_KEYRING_CONTROL
fi
/usr/bin/mysql-workbench ${@}

Apply permissions :

chmod +x /usr/local/bin/mysql-workbench

The author suggested that only this should fix the problem, but I had to edit my gnome desktop entry to use the icon shortcut from menu :

/usr/share/applications/mysql-workbench.desktop

Changing the line Exec=mysql-workbench to Exec=/usr/local/bin/mysql-workbench :

[Desktop Entry]
Name=MySQL Workbench
Comment=MySQL Database Design, Administration and Development Tool
Exec=/usr/local/bin/mysql-workbench
Terminal=false
Type=Application
Icon=mysql-workbench
MimeType=application/vnd.mysql-workbench-model;
Categories=GTK;Database;Development;

Now I can use my shortcut menu and it is working!!!

DependencyHell
  • 1,027
  • 15
  • 22
1

One year and few months have passed since the last solution, but I want to conrtibute with my solution.

I followed the solution from DependencyHell, however I made small modifications.

Instead of create a new mysql-workbench script on: /usr/local/bin/

I change the original mysql-workbench on:

/usr/lib/mysql-workbench

And just add this if after the last IF:

#!/bin/sh
if [ -n "${XDG_RUNTIME_DIR}" ]; then
  GNOME_KEYRING_CONTROL="${XDG_RUNTIME_DIR}/keyring/control"
  [ -z "${GNOME_KEYRING_CONTROL}" ] || export GNOME_KEYRING_CONTROL
fi

And run my workbench from the original shortcut and all work very well and I can store my passwords on keychain.

Regards.

  • I wasn't sure which script to edit to add this IF statement. I am using Ubuntu 19.04 and just installed mySQL Workbench 8.0.16, and my /usr/lib/mysql-workbench contains all the .so files and some executables such as mysql, but I do not see any scripts to edit. What was the name of the script that I should add this IF statement to? – ScottK Jun 17 '19 at 18:05
  • Same issue as @ScottK for me as well on Kubuntu 19.04 – Geo242 Jul 09 '19 at 19:53
  • Hello, in my case using Debian 8, the script (file) that I modify was "mysql-workbench", that in my case it's located in: /usr/lib/mysql-workbench. If You do not have this file in this path or even the path that I use. I suggets You that create the file "mysql-workbench" in the next path: /usr/local/bin/ Regards. – José Ignacio Arriaga Castillo Jul 11 '19 at 01:27
0

I tried OP solution on Manjaro KDE and it worked just fine !

Just had to replace apt by paru :

sudo apt-get install gnome-keyring

became :

paru gnome-keyring

I took default after that.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

From the Ubuntu help, it works

  1. Go to your Home folder by typing 'home' in the dash.
  2. Press Ctrl+H(or click View ▸ Show Hidden Files.)
  3. Double click on the folder .gnome2 or .local/share/keyrings in Ubuntu >= 14
  4. Double click on the folder called keyrings.
  5. Delete any files you find in the keyrings folder.
  6. Restart the computer.

Source - https://askubuntu.com/posts/191249/revisions

Himanshu HC
  • 47
  • 1
  • 5