SpringBoot下application配置文件连接mysql8.0

    技术2022-07-31  90

    配置文件

    # 数据库配置 spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver spring.datasource.url = jdbc:mysql://localhost:3306/test?characterEncoding=utf-8&serverTimezone=UTC&useSSL=false spring.datasource.username = root spring.datasource.password = ysq123 mybatis.mapper-locations= classpath:mapping/*.xml mybatis.type-aliases-package=com.xxxx.xxxx.bean #所在包 mybatis-plus.mapper-locations=classpath:mapping/*.xml # Thymeleaf配置 spring.thymeleaf.enabled=true spring.thymeleaf.encoding=utf-8 spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.cache=false spring.thymeleaf.mode=HTML5 spring.thymeleaf.suffix=.html 其中, spring.datasource.url = jdbc:mysql://localhost:3306/**test**?characterEncoding=utf-8&serverTimezone=UTC&useSSL=false 加粗字体为你自身数据库名,username与password都为自己的账号密码。
    Processed: 0.008, SQL: 9