• Magic-Club开发--第十天


    一、今日完成

      调试服务器端

      1.报错:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

      原因:时区问题

      解决方法:将

    server:
      port: 8080
    spring:
      datasource:
        url: jdbc:mysql://127.0.0.1:3306/db_user
        username: root
        password: 1234
        driver-class-name: com.mysql.cj.jdbc.Driver
    mybatis:
      mapper-locations: classpath*:mapper/*.xml

      更改为

    server:
      port: 8080
    spring:
      datasource:
        url: jdbc:mysql://127.0.0.1:3306/db_user?serverTimezone=GMT%2B8
        username: root
        password: 1234
        driver-class-name: com.mysql.cj.jdbc.Driver
    mybatis:
      mapper-locations: classpath*:mapper/*.xml

       2.报错:Wed Aug 28 17:21:02 GMT+08:00 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

      原因:mysql-connector版本加密方式改变

      解决方法:修改pom.xml

    <dependency>

    <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.11</version>
    </dependency>

    二、明日计划

      继续调试数据库。

    三、个人小结

      今日询问学长,解决了一部分问题,但是spring始终冲突,放弃jpa后,改用MyBatis+MySQL进行数据访问,依旧冲突。明日计划重新下载maven文件,尝试重新加载。

      报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDao' defined in file [F:Magic_Club2 argetclassescomexampledemodaoUserDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver。

      原因:maven引用冲突。

      解决方法:暂无。

  • 相关阅读:
    Idea 一些常用的小工具
    玩转SpringBoot之定时任务详解
    mysql 创建自定义函数
    mysql
    一段mysql脚本,生成一些随机数时使用。
    mysql 命令行常用操作与mysql too many connections 解决方法
    如何获取多个分组之后的第一条数据
    Linux aliyun ECS CentOS8 服务器安装Redis 部署集群 ,JDK安装与Tomcat配置
    Redis 各个版本下载地址
    centos7安装mysql5.7(rpm安装版)与 Mysql 权限
  • 原文地址:https://www.cnblogs.com/ljq1313/p/11425852.html
Copyright © 2020-2023  润新知