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 ?
asked May 12, 2020 at 10:24
2
Change the settings on Dbeaver
:
- Right click your connection, choose
Edit Connection
- On the
Connection settings
screen (main screen) click onEdit Driver Settings
- Click on
Connection properties
- Right click the
User Properties
area and chooseAdd new property
- Add two properties:
useSSL
andallowPublicKeyRetrieval
- Set their values to
false
andtrue
respectively by double clicking on thevalue
column - Save and test the connection.
Hopefully it should work!
answered May 21, 2020 at 17:02
Ratish BansalRatish Bansal
1,8921 gold badge10 silver badges19 bronze badges
6
Edit Connection
click second tab Driver Properties
Change property allowPublicKeyRetrieval
to True
Connection settings
or Driver properties
:
answered Mar 8, 2021 at 18:00
OxaCyberOxaCyber
4215 silver badges3 bronze badges
Did you try explicitly allowing public key retrieval in DBeaver?
In the connection settings, SSL tab you can find it
This is in case you are using SSL, otherwise in the same screen you can disable SSL by unchecking «use SSL» and «require SSL»
answered May 16, 2020 at 6:37
Carlos RoblesCarlos Robles
10.8k3 gold badges41 silver badges60 bronze badges
0
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
:
answered Jun 2, 2020 at 22:31
agm1984agm1984
15.1k6 gold badges89 silver badges110 bronze badges
System information:
- Operating system (distribution) and version: Pop_OS 20.4
- DBeaver version: 7.15
- Additional extensions: None
Connection specification:
- Database name and version: MySQL 8.0.21
- Driver name: mysql-connector-java:RELEASE [8.0.17]
- Do you use tunnels or proxies (SSH, SOCKS, etc)?
Describe the problem you’re observing:
I created a docker instance with the command:
docker run --name mysql -e MYSQL_ROOT_PASSWORD=123456 -d -p 3306:3306 mysql
But when I try to create a new connection, it throws an error saying:
Public Key Retrieval is not allowed
I saw people on stackoverflow changing the driver property AllowPublicKeyRetrieval to true and the option useSSL to false. And it really works. But when I was tweaking the properties, I found that you don’t really need to change those properties to make it work, you can just set useSSL or sslMode to another value, it can be an invalid value, and change this properties back to its default values and the connection works as intented, even if I put useSSL to false, the connection still works with no problem, unless I remove the container and create again, where the initial error returns. In my vision, if it is working with the properties manually set, it should work with the default ones too, this is why I’m submiting this as a bug. If it is not, can someone please explain why this happen?
Steps to reproduce, if exist:
- Create a new docker container with the command:
docker run --name mysql -e MYSQL_ROOT_PASSWORD=123456 -d -p 3306:3306 mysql
-
Create a connection for MySQL with the root user and the password 123456.
-
When testing the connection, it should throw the error saying Public Key Retrieval is not allowed.
-
Go to the tab Driver Properties, look for the option useSSL change it to false and test the connection, it should give you the same error as before.
-
Now change the property back to true, and the connection should work.
-
The connection works even if I set the property back to false. What I don’t understand.
-
Instead of changing the property to false, you can put any other invalid value, test the connection, it will throw an error saying the value is not acceptable, change the property back to true, the default value, test the connection, and it will work.
-
Instead changing the useSSL property, you can change the sslMode property. Change it from PREFERRED to DISABLED, test the connection, the error will persist, change it back to PREFERRED, the error goes away. You can, too, put a invalid value, test the connection, change it back to PREFERRED and now the connection works.
Include any warning/errors/backtraces from the logs
Dbeaver gives public key retrieval is not allowed error.
While connecting to the Dbeaver it will give the public key retrieval is not allowed error as:
Cause: Parameter allowPublicKeyRetrieval
is false. allowPublicKeyRetrieval=true
to allow the client to automatically request the public key from the server.
Resolution: Use the allowPublicKeyRetrieval=true
jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true
In Dbeaver: Go to connection then select the Driver Properties tab and change the allowPublicKeyRetrieval to true.
Я использую DBeaver для просмотра базы данных SQL в MySQL 8+.
Все работает, но иногда, открывая DBeaver, появляется следующее сообщение об ошибке:
Public Key Retrieval is not allowed
И тогда DBeaver не может подключиться к MySQL.
Чтобы решить эту проблему, мне нужно перенастроить MySQL.
Есть ли самый простой способ решить эту проблему?
2020-05-12 13:24
4
ответа
Решение
Вы пытались явно разрешить получение открытого ключа в DBeaver? В настройках подключения на вкладке SSL вы можете найти его
Это в случае, если вы используете SSL, в противном случае на том же экране вы можете отключить SSL, сняв флажки «использовать SSL» и «требовать SSL».
2020-05-16 09:37
Измените настройки на Dbeaver:
- Щелкните правой кнопкой мыши ваше соединение и выберите «Редактировать соединение».
- На экране «Настройки подключения» (главный экран) нажмите «Изменить настройки драйвера».
- Щелкните «Свойства соединения».
- Щелкните правой кнопкой мыши область «Свойства пользователя» и выберите «Добавить новое свойство».
- Добавьте два свойства:useSSL и allowPublicKeyRetrieval.
- Установите для них значения «ложь» и «истина», дважды щелкнув столбец «значение».
- Сохраните и проверьте соединение.
Надеюсь, это сработает!
2020-05-21 20:02
Изменить соединение
нажмите вторую вкладку «Свойства драйвера»
Изменить свойство allowPublicKeyRetrieval = True
Настройки подключения / Свойства драйвера:
08 мар ’21 в 21:00
2021-03-08 21:00
2021-03-08 21:00
Решение Ratish Bansal у меня работает на MacOS Mojave, и после этого я всегда получаю ошибку часового пояса. Решение для этого — установить мой местный часовой пояс вconnection settings
:
2020-06-03 01:31
Sign in to follow this
Followers
0
By
Perpetual Newbie, November 17, 2018 in General discussions
Recommended Posts
Perpetual Newbie
1
Posted November 17, 2018
Can’t connect to MySQL with DBeaver. Error:
Public Key Retrieval is not allowed
How to fix?
Share this post
Link to post
Share on other sites
C.M.
15
Posted November 17, 2018
Add option allowPublicKeyRetrieval with vaule true in MySQL driver settings.
-
1
-
1
Share this post
Link to post
Share on other sites
Perpetual Newbie
1
Posted December 4, 2019
Wow, that simple? 👀
It works now! Thanks for your help again 😊
Share this post
Link to post
Share on other sites
Everlasting Summer
4
Posted August 14, 2021
17.11.2018 в 16:27, C.M. сказал:
Add option allowPublicKeyRetrieval with vaule true in MySQL driver settings.
Thank you. It worked 👍
Share this post
Link to post
Share on other sites
Sign in to follow this
Followers
0
Go To Topic Listing