springboot work with mysql

I am so terrible.
I have learned springboot for weeks and achive no success.
I am upset.
I've forgot the whole lessons when I learn a new one and that's killing me.
and now let's count.
I've learned eight lessons and there's four which are key lessons.
1 - how to access the static source
2 - how to catch the exception overall situation.
3 - how to work with the freemarker.
4 - how to work with the JSP
and now,I am working on how to work with the mysql.
I just made a mistake that comes out an error when I try to run my apps.
Let's organize our thoughts.


first of all,we'll add dependencies into the pom file.
and that's it:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>
  </dependencies>

and second,we'll add some content into the application.properties file,just like this:

spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

the datasource url shows that we'll entry the test database and that's true.
and all the things are correct by now and it will achive a success smoothly.

write an service.class

I've wrote a UserService.class just like this:


the error message shows belows:

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.
image

my mysql verison is 8.0.15。但是,在我的引入的依赖当中,

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容