MySQL: "Could not create connection to database server" when creating database

Hi,

I switch from HSQL to MySQL in a project and everytime I tried to create the database I get the error
MySQLNonTransientConnectionException: Could not create connection to database server (see attachment).

When I test the connection in the project properties dialog, everythink works fine:

2019-02-18%2014_39_40-yarg-email-template-addon%20%5BC__Users_Brueck_StudioProjects_emailtemplate-addon%5D%20-

I hope someone can help me.

Greetings
Andreas

log.txt (1.0 KB)

Hi.
Could you please share idea.log with us?. You could find it here:
image

Also, could you please provide the version of JDBC connector that you use?

Hi Natalia,

I think I found the problem. I use MySQL 8 with JDBC-Driver 8.0.13. But in your automatically created build.gradle you use version 5.1.46:

def mysql = ‘mysql:mysql-connector-java:5.1.46’

After changing it to 8.0.13

def mysql = ‘mysql:mysql-connector-java:8.0.13’

everything works fine.

Greetings
Andreas

We strongly recommend using the 5.1.46 version of the driver, here is the link to download. Using version 8.0.13 may cause some problems.

Hi,
I have encounter the same problem, i inspect the idea.log and found the problem.
The workround is append a parameter to url : serverTimezone=UTC

1 Like