Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connexion between DBeaver & MySQL

Tags:

mysql

dbeaver

I use DBeaver to watch an SQL database on MySQL 8+.

Everything is working, but sometimes, opening DBeaver, I have the following error message :

Public Key Retrieval is not allowed

And then, DBeaver can't connect to MySQL.

In order to fix this problem, I have to reconfigure MySQL.

Is there any simplest way to fix this problem ?

like image 374
Alex Dana Avatar asked May 12 '20 10:05

Alex Dana


People also ask

What is DBeaver?

What is DBeaver? DBeaver is an Open-source and Multi-Platform Administration Database Tool that allows you to query data present in various database environments. In other words, DBeaver is a SQL client that connects with more than 80 database applications like MySQL, PostgreSQL, Oracle, Snowflake, and much more.

Where can I find DBeaver connections?

DBeaver connections are stored in file .dbeaver-data-sources.xml, in DBeaver workspace, which is in % {HOME/.dbeaver4/General/ by default. If the folder .dbeaver does not exist in a fresh installation you will need to create. Connections: ~/snap/dbeaver-ce/61/.local/share/DBeaverData/workspace6/General/.dbeaver/

Can DBeaver connect to a foreign database?

Many RDBMS offer a way to logically access foreign databases as if they were local, in which case DBeaver would then be able to access the data from the OLD database (as far as DBeaver is concerned in this situation, all the data is coming from a single connection).

How do I connect to MySQL using DBeaver?

Within the DBeaver main window click the New Connection Wizard button (below File-- Figure A ). The DBeaver main window. In the resulting window select MySQL from the list and click Next.


Video Answer


4 Answers

Change the settings on Dbeaver:

  1. Right click your connection, choose "Edit Connection"
  2. On the "Connection settings" screen (main screen) click on "Edit Driver Settings" enter image description here
  3. Click on "Connection properties"
  4. Right click the "user properties" area and choose "Add new property"
  5. Add two properties: "useSSL" and "allowPublicKeyRetrieval" enter image description here
  6. Set their values to "false" and "true" by double clicking on the "value" column
  7. Save and test the connection.

Hopefully it should work!

like image 161
Ratish Bansal Avatar answered Oct 21 '22 07:10

Ratish Bansal


Edit Connection

click second tab "Driver Properties"

Change property allowPublicKeyRetrieval = True

Connection settings/Driver properties:

enter image description here

like image 32
OxaCyber Avatar answered Oct 21 '22 08:10

OxaCyber


Did you try explicitly allowing public key retrieval in DBeaver? In the connection settings, SSL tab you can find it

enter image description here

This is in case you are using SSL, otherwise in the same screen you can disable SSL by unchecking "use SSL" and "require SSL"

like image 14
Carlos Robles Avatar answered Oct 21 '22 09:10

Carlos Robles


Ratish Bansal's solution works for me on MacOS Mojave, and after that, I always get a timezone error. The solution for that is to set my local timezone in the connection settings:

enter image description here

like image 2
agm1984 Avatar answered Oct 21 '22 09:10

agm1984