Purpose: get MySQL 8.3.0 connection from Spring Boot 3.2.4 application using plain java.sql.DriverManager.getConnection(url, username, password).
Issue: during connection acquire - MySQL for few seconds shows "unauthenticated user". Java application just stales on this action without any log messages. I tried to debug DriverManager - stales on socket acquiring.
Setup: - Docker: 26.0.0 - Spring Boot: 3.2.4 - com.mysql:mysql-connector-j:8.3.0
Successful scenario: - image: eclipse-temurin:21-jre-alpine
Failing scenario: - image: eclipse-temurin:22-jre-alpine (tried other images too - openjdk, amazon correto - issue is the same)
If I run Spring Boot: 3.2.4 application directly from IntelliJ using Java 22 (without docker) - no issues If I run java.sql.DriverManager.getConnection from Java 22 container using jshell - no issues. It seems that connections stops working after Spring Boot 3.2.4 loads up.
Comment From: wilkinsona
Thanks for the report. Unfortunately, there isn't enough information for us to be able to diagnose the problem. Spring Boot isn't directly involved with connection to MySQL. If it's stalling when trying to open a socket, that sounds like a networking problem. It could be that the wrong network address is being used – this could be a Spring Boot problem – or it could be something at a lower level which could be a JDK or Docker networking problem.
If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.