G. Dawid
G. Dawid

Reputation: 172

Connect MySQL to Java via IntelliJ IDEA

I want to connect MySQL with Java via IntelliJ IDEA.

I'm using MySQL. Settings are:
Host:127.0.01
Port:3306
User:root
Name of database I want to use is School.

In IntelliJ I add DB Navigator, setting are:
Name School
description: ..
Host: localhost
Port: 3306
User: root
Password: password that work in MySQL

After all I get a error:

"Cannot connect to School. The server time zone values "CET" is unrecognized or represent more then one time zones. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specific time zone value if you want to utilize time zone support.

I use Poland timezone. Do you have any advice how to fix it?

Upvotes: 0

Views: 3000

Answers (3)

I just had the same issue,

My fix was just leave the default database name, as is.

Do not change the default name: mysql.

Else check your ports, if needed.

Mine is 3308.

Upvotes: 0

Fabrício Gonga
Fabrício Gonga

Reputation: 21

I had the same problem and solved it as follows

  1. looks for a customized database

  2. Select the type of database

  3. data In the url insert the link

    jdbc:mysql://localhost:3306/mysql?serverTimezone=UTC

  • localhost - is the servior

  • 3306 - is the door

  • serverTimezone - Time zone of your zone

insert image description here

Upvotes: 1

ed3d
ed3d

Reputation: 93

Go to the Properties tab and add a new property named serverTimezone with the value UTC.

Upvotes: 6

Related Questions