0

I test database connection using Database Naviagator in IntelliJ. but there is a problem. How can I fix it? ERROR

MySQL Server version : 5.1.41-community MySQL Community Server

[build.gradle]

runtimeOnly 'mysql:mysql-connector-java:5.1.34'

[application.properties]

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/example?
                      serverTimezone=UTC&characterEncoding=UTF-8
spring.datasource.username=[my user name]
spring.datasource.password=[my password]



<===== Solution =====>

  1. Upgrade MySQL Server version 8.0.25

  2. build.gradle

    runtimeOnly 'mysql:mysql-connector-java'
  1. application.properties
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/example?characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=[username]
spring.datasource.password=[password]
  1. modify my.ini
    1) location=> C:\ProgramData\MySQL\MySQL Server 8.0
    2) open my.ini
    3) insert into [mysqld] section
    => default-time-zone='+9:00'

  2. restart mysql

Hope it help someone :)

HyewonJu
  • 3
  • 2
  • 2
    Does this answer your question? [Use JDBC/Mysql Connector in intellij idea](https://stackoverflow.com/questions/30651830/use-jdbc-mysql-connector-in-intellij-idea) – nbk Jul 11 '21 at 13:41
  • 1
    The connection in IntelliJs DB Navigator has nothing to do with your configuration in Gradle or Spring's properties. As an aside, MySQL Connector/J 5.1.34 is pretty old. Upgrade to the latest 5.1.x, or better yet to the latest 8.0.x. – Mark Rotteveel Jul 11 '21 at 13:44

0 Answers0