MySQL JDBC Driver 5.1.33 - Time Zone Issue

前端 未结 30 1657
栀梦
栀梦 2020-11-22 05:22

Some background:

I have a Java 1.6 webapp running on Tomcat 7. The database is MySQL 5.5. Previously, I was using Mysql JDBC driver 5.1.23 to connect to the DB. Ever

30条回答
  •  孤城傲影
    2020-11-22 05:59

    I faced the same error and in my case, I change the Server Port Number to 3308 where previously it was 3306. This connect my project to the MySQL database.

    Here we have to change the connection code also.

    Class.forName("com.mysql.cj.jdbc.Driver");
    cn=(java.sql.Connection)DriverManager.getConnection("jdbc:mysql://localhost:3308/test2?zeroDateTimeBehavior=convertToNull","root","");
    

    Changing the port number in the connection code is also necessary as localhost:3308 to resolved the error.

    Also, the admin properties in my case.

提交回复
热议问题