MySQL Connection error with default Driver Properties
See original GitHub issueSystem 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@paulosandinof You should set client option allowPublicKeyRetrieval=true on driver properties tab, more information please reference here
https://github.com/dbeaver/dbeaver/issues/3447
After all I don’t see what we can do here.
DBeaver changes some driver properties implicitly according to connection configuration (e.g. SSL config, target database name and a few others). Thus these user-defined properties are ignored. But this is an expected behavior.
Any ideas are welcome though.