Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

MySQL Public Key Retrieval is not allowed

Thu Yein Tun April 19, 2018

My db server is mysql 8.0.11 and driver version 5.1.46. 

When ssl is enabled, and tries to connect to the database, confluence setup reports the following. 

Problem connecting to your database

SQLState - S1000
java.sql.SQLException: Illegal operation on empty result set.

 

But if "skip_ssl" is written to my.cnf and restarted mysql, then it shows the following error message.

 

Problem connecting to your database

SQLState - 08001
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

Below is the output of logs/catalina.out

20-Apr-2018 14:35:35.680 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 6392 ms
Fri Apr 20 14:37:39 SGT 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

 

I also tried with the following connection string to disable verification and ssl

 

jdbc:mysql://localhost/confluencedb?verifyServerCertificate?=false&useSSL=false 

 

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

7 votes
Answer accepted
Thu Yein Tun April 20, 2018

For prosperity purposes, this has been solved by downgrading mysql 8.0 to mysql 5.7.22. Confluence documentation should state that it is not compatible with mysql 8.0.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 20, 2018
Mohamid Shaker August 2, 2018

.

Mohamid Shaker August 2, 2018

Hi Thanks for your answer. I had have same problem so the solution that's worked for me it's by deleting useSSL= false at all. 

Maybe because i dont ssl file at all in my computer !!

Like # people like this
PhoodeeApp March 16, 2019

i am suing DBeaver for database connection. where should i enable this ?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 16, 2019

We probably can't tell you - this is a place for Atlassian people, only a few of us might have experience with Dbeaver.

Andre Tzermias April 9, 2019

@PhoodeeApp 

 

To 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"

 

2019-04-09 16_36_09 - Screenshot.png

3) Click on "Connection properties"

4) Right click the "user properties" area and choose "Add new property"

5) Add two properties: "useSSL" and "allowPublicKeyRetrieval"

6) Set their values to  "false" and "true" by double clicking on the "value" column

2019-04-09 16_36_22 - Screenshot.png

Save and re-test the connection. Hopefully it should work!

Like # people like this
Pierre Silva August 31, 2019

Nice...

abitencourtjunior October 27, 2019

This worked for me, thanks.

Marco Vargas January 25, 2020

Great work @Andre Tzermias , it worked great for me.

Israel Araujo January 29, 2020

Obrigado @Andre Tzermias , funcionou perfeitamente para mim.

Julien FENEROL February 1, 2020

It works! Thanks a lot :)

sparten117 March 14, 2020

That worked for me Thank You

pgavilan March 27, 2020

THANKS!!! GRACIAS!!!

ahenteti August 5, 2020

Thanks @Andre Tzermias it works great for me :)

Juan Carlos Ramos August 6, 2020

It works! Thanks a lot!!

vedprakash1985 August 9, 2020

It works !!thanks 

Felipe Sartori August 23, 2020

Worked for me!

Jesman Dzimba September 21, 2020

Super grateful

Claudio Barca October 7, 2020

This worked for me. Thanks.

Amit Luthra November 3, 2020

Thanks! it worked for dbeaver

Spice Jamo January 26, 2021

thanks it works great!!

Alejandro Campos April 23, 2021

Thanks a lot! its works in DBeaver v21.0.3

luigi.izzo May 3, 2021

Worked for me!

RuiFortes July 11, 2021

Same here! Thanks :-)

Santiago VB October 15, 2021

Works! Wonderful.

amanda91 January 27, 2022

Thanks, worked for me!

Raul H_ Lapitzondo February 19, 2022

This worked, thanks.

7 votes
chethan bv June 20, 2018
jdbc:mysql://localhost/confluencedb?allowPublicKeyRetrieval=true&useSSL=false 

use this 

aajjss3 July 16, 2018

This worked for me, thanks.

xZHARKONx September 20, 2018

Hola que tal, a mi me a funcionado tu configuración para mi pool de conexiones, en Mysql 8.0 Corriendo en Glassfish 5 :D
Gracias, Saludos.

Hi, this my configuration,  i worked in Mysql 0.8 with Glassfish 5 Server, Thanks :D
Diver:

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version>
</dependency>

PoolDeConexiones-GlassfishServer.pngPoolDeConexiones-GlassfishServerPing.png

1 vote
Josep Llort Tella June 7, 2018

I think the issue is because you have followed the MySQL installation wizard and you have setup the "Use Strong password encription" option what now comes by default rather "Legacy authentication". If you are on Windows, you can execute the installer, click on reconfigure , follow the wizard and switch to Legacy.

Another solution is to fight with SSL Authentication ( not trivial ); below some url:

https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-using-ssl.html

https://dev.mysql.com/doc/refman/5.7/en/creating-ssl-rsa-files-using-mysql.html

Also be sure you are using the latest driver for working with MySQL 8. If you at the end disable SSL, remove from your query connection the "verifyServerCertificate=false&useSSL=false" or you will get another errors ( yes it's a jigsaw ).

Dp H July 14, 2018

This worked. Thanks so much!.. 

If you change the password encryption from "Use Strong password encryption" to "Use legacy password encryption" to be compatible with MySQL 5.x connectors this will be solved.

On Mac, go to System Preferences -> MySQL -> Initialize Database to change this setting. 

0 votes
dilli lekhak June 13, 2020

Hi, I am using macOS Catalina, Version 10.15.5, and faced the same error in my eclipse console while running my application. I had upgraded to MySQL 8.0.20 on the same day after facing some issues with homebrew. After going over the above comments and suggestions, I solved it by adding the following in my application properties:

spring.datasource.url=jdbc:mysql://localhost:3306/myDatabase?allowPublicKeyRetrieval=true

 

Thanking for your feedback.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events